Code Snippets: Linux Bash/CSH

Updated: Feb 9

BASH:

rsync - quick recursive file copying

rsync --progress -r -u --del "path/to/files/you/want/to/transfer/*" "/path/to/directory/you/want/to/transfer/to"
read

-- progress show progress during transfer more information

- r recurse into directories

- u skip files that are newer on the receiver

-- del delete extraneous files from dest directories (during transfer)


copy

\cp "path/to/file/you/want/to/copy" "path/to/desired/directory"

create an alias

gedit ~/.bashrc

opens the startup file where the alias should be added

alias aliasname='alias command'

format for adding the alias

 

CSH:

create an alias

gedit ~/.cshrc

opens the startup file where the alias should be added

alias aliasname 'alias command'

format for adding the alias


create an alias with extra input

alias aliasname 'alias command \!$'

running 'aliasname test' will run 'alias command test'


create a multi-line alias

alias aliasname 'alias command 1 ; alias command 2'

72 views