Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Questions about the Terminal application or its terminal emulation should use this tag. Use **command-line** for questions about shells or command-line programs that do not specifically involve Terminal.
2
votes
Accepted
locate `pre-commit` and not `pre-commit.sample`
locate uses shell-style globbing so the options for the pattern are kind of limited.
The simple way probably is to just run
locate pre-commit | grep -v 'sample$'
Or you could make use of the special …
8
votes
Accepted
Is kill -15 the same as File -> Quit?
kill acts on Unix level, the targeted process is free to ignore any signal besides kill -9. And depending on the internal structure of the process you are looking at, kill -15 will not be the same as …
2
votes
How to produce constant output in a Terminal window?
Something like
while sleep 1; do
t=$(( RANDOM % 80 ))
for ((i=0; i < $t; i++)); do
echo -n '*'
sleep 1
done
echo
done
might do the trick. Change the length of the sl …
2
votes
Print All Files in Folder and SubFolders
An easy way to get the same result is
find . -type f
which basically is identical to
find . -type f -print0 | xargs -0 -n 1 ls
9
votes
Accepted
cd to directory with name of `-`
You can use either relative or absolute paths to prevent the - from standing alone and confusing bash's build in command cd:
mkdir ./-
cd ./-
1
vote
Accepted
How do I remove a directory that has a file with colon in it
Assuming it is on your local drive
rm DIRECTORY/*\:*
should remove the file.
0
votes
How to check the progress of files moved from one place to another in terminal?
What you can do instead is
open a new Terminal tab with Cmd-T
check the size of the target file by running ls -l location2 …
1
vote
I am running a while loop which ends in & and I closed the terminal, so I can't stop it now
Open a new Terminal tab/window
Run ps alx|grep "[s]leep 1" (maybe several times, until you get the sleep 1 as part of the output
pse@Mithos:~$ ps alx|grep sleep 1
502 1268 1245 0 20 0 2432796 …
4
votes
Terminal not recognizing imacro:// as protocol, thinks it's a pathname
Use
open /Applications/Firefox.app --args 'imacros://run/?m=macro.iim'
to prevent open from messing with the argument. Also quoting might help to stop the shell from stumbling over any special char …
2
votes
Using cat output in osascript in terminal
Basically you need to read the file content into a variable first. There are several ways to do this, one is
text=$(< TEXTFILE)
osascript ... "$text"
1
vote
Accepted
List main folders that contain non changed folders and files since a specific date
cd <to directory containting the main folders>
for d in */; do
if [[ $(find "$d" -mtime -26w | fgrep -v .. | wc -l) -eq 0 ]]; then
echo "$d"
fi
done
should work, with the usual cavea …
1
vote
How to launch a terminal which executes vim from a script?
You can get something close by using the "New command" entry from the File menu (also accessible through Shift-Cmd-N) to run vim in a dedicated tab/window.
You could also just run the GUI version of …
1
vote
Merge files & keep bigger file if duplicates?
If you omit the size test
find f1 f2 f3 f4 -type f -exec mv {} f0/ \;
should do the trick.
With a line count (so the file with more lines wins) and assuming that all files are text files it gets a …
1
vote
Accepted
Running multiple commands in terminal
It indeed are multiple commands which get run here. If you look up man env you'll find
SYNOPSIS
env [-iv] [-P altpath] [-S string] [-u name] [name=value ...] [utility [argument ...]]
which expl …
3
votes
Accepted
Transferring multiple files from one folder to another using Terminal
This is more difficult than it may seem. The following assumes that all images to be copied are in the same directory (no sub directories).
cd "PATH/TO/Paras_all"
count=0
find . -maxdepth 1 -iname '* …