See also
- yEd/linux_command_line_introduction.graphml
- https://www.youtube.com/watch?v=DBPTyJcH04U
Command line tips and tricks for beginners
- Quick start
- Working directory
- Open folder
- Tab completion
- Go back to previous folder
- Symbolic links
- Aliases
- Key bindings
- Prompt
- find
- Regular expressions
- Move cursor backwards and forwards
- Redirect output
- Others
- create a
~/.bashrc
file - copy the contents of https://raw.githubusercontent.com/sarnobat/unix/master/.bashrc
pwd
open .
mkdir test
mkdir mydir/subdir
cd -
For changing directory more quickly
cd my<tab>/su<tab>/
ln -s ~/mydir/subdir
To get more idea where you are
- host
- working directory
- user
PS1='\w >
alias l="ls -lrt"
For quickly executing repetitive commands
Terminal.app:
Preferences
Profiles
Keyboard
Use Option as Meta Key
bind ' "\el":"ls -lrt\n"'
find | grep Cache
find | grep Cache | xargs grep --color powermock
find -iname "*.java" | sed -e 's/.*src.\(.*\).java/\1/' | sed -e 's/\//./g'
This comes automatically with Terminal.app
Alt-left
find -iname "*.java" | sed -e 's/.*src.\(.*\).java/\1/' | sed -e 's/\//./g' > out.txt
sudo lsof -i:80
ps aux
osascript -e 'display dialog "Built"'
;
&&
ls ~/non-existed-file && echo "file exists" || echo "file does not exist"
Copy large files with progress indication, across a network, and preserve original timestamps.
rsync
~/bin/
vim
- Syntax highlighting
crontab -e
tail
unzip
expect
awk
uname -a