popd: cd but remember where you werepushd: return to origin directory<command> | wc -lls -lrt | awk '{ total += $5 }; END { print total }'-v : verbose-r : copies data recursively (but don’t preserve timestamps and permission while transferring data-a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps-z : compress file data-h : human-readable, output numbers in a human-readable formatrsync -avz localdir/ user@remotehost:/remotedirrsync -avzh user@remotehost:/remotedir /localdirSee more examples at: Techmint Rsync examples
Basic construction:
find <dir> <something>
Useful options
-mtime (modification time); e.g -1 is one day ago can be between with -mtime -1 -mtime +2-name '*.txt'-type -[d,f] ; f=file, d=directory-L follows symbolic links-exec ls -l {} \;-empty; find files of zero length or empty directoriesCombining commands
-name '*txt' -exec grep “something” {} \; equivalent to
find -name ‘*txt’ | xargs grep “something”The CEDA command line arrivals deleter
arrivals_deleterLinux command cut is used for text processing. You can use this command to extract portion of text from a file by selecting columns.
$ cut -c2 test.txt$ cut -c1-3 test.txt$ cut -c3- test.txt$ cut -c-8 test.txt$ cut -c- test.txt$ cut -d':' -f1 /etc/passwd$ grep "/bin/bash" /etc/passwd | cut -d':' -f1,6$ grep "/bin/bash" /etc/passwd | cut -d':' -f1-4,6,7$ grep "/bin/bash" /etc/passwd | cut -d'|' -f1$ grep "/bin/bash" /etc/passwd | cut -d'|' -s -f1$ grep "/bin/bash" /etc/passwd | cut -d':' --complement -s -f7grep "/bin/bash" /etc/passwd | cut -d':' -s -f1,6,7 --output-delimiter='#'$ grep bala /etc/passwd | cut -d':' -f1,6,7 --output-delimiter=$'\n'ps axu | grep python | sed 's/\s\+/ /g' | cut -d' ' -f2,11-(Thanks to Alan Iwi for this information)
nohup ./{script} > {filename}.out 2>&1&scp {data} {username@loc:/destination} Stop process: CTRL+z Set to run in background: bg {Process_ID} Release process from session: disown -h {Process_ID}Remove from end of string
a=test01.ncb=${a%nc}echo b=> test01.To remove from start of string use #
for (( y=1; y<=10; y++)); do ....doneLoops using alphabet and typeset to set length of a counter string
$ typeset -Z2 counter$ counter=00$ for ens in {a..z}; do $ ((counter=counter+1))$ echo $counter$ echo $ens$ donecat {argsfile.txt} | xargs {script.sh}
Create a symbolic link with the command
$ ln -s <source> <linkname>source is the directory to link to
linkname is the symbolic link name to the source
dvips {filename}.dvips2pdf {filename}.ps {filename}.pdflp -d{PRINTER} -o {filename} (-o fit to page)
Python: setup epd CDO: setup cdo cp cp -p: preserves permissions.scprsync -a(v)zhe ssh <data> <destination>usbcheckusbejectlatex <filename>bibtex <filename>xdvi <filename>dvips <file>.dvips2pdf <file>.ps <file>.pdfa2ps <file> | lp -d<printer>xpprlpstatrcancelncdump -c <file> | morencdump -h <file>CREATE: tar cf <file>.tar <files>RESTORE: tar xf <file>.tarCREATE: tar -xcvf <file>.tgz <files>RESTORE: tar -zxvf <file>.tgzgrepwhenceps -u <userid>ps kill [-9]bg: &, CTRL+z "bg"fg: "fg" ls -lls -ltrls -lqls -lhls -F (directories)ls -F <dir> look in dirls -sh (size in h converts to human readable)du -sh */df -h