NameDesc
( cd /dir/to/copy && tar -c . ) | ( cd /where/to/ && tar -x -p )Copy (with permissions) contents of copy/ dir to /where/to/
( tar -c /dir/to/copy ) | ( cd /where/to/ && tar -x -p )Copy (with permissions) copy/ dir to /where/to/ dir
( tar -c /dir/to/copy ) | ssh -C user@remote 'cd /where/to/ && tar -x -p'Copy (with permissions) copy/ dir to remote:/where/to/ dir
(cd dir && command)Go to dir, execute command and return to current dir
(cd dir/ && wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html)Store local browsable version of a page to the current dir
[ $(date -d '12:00 +1 day' +%d) = '01' ] || exitexit a script unless it's the last day of the month
> filetruncate data of file or create an empty file
alias l='ls -l --color=auto'quick dir listing
apropos whatisShow commands pertinent to string. See also threadsafe
badblocks -s /dev/sdaTest for unreadable blocks on disk sda
BLOCK_SIZE=\'1 ls -lUse locale thousands grouping in ls. See also l
bzip2 -dc dir.tar.bz2 | tar -xExtract archive (use gzip instead of bzip2 for tar.gz files)
cal -3Display a calendar
cal 9 1752Display a calendar for a particular month year
cat /proc/partitionsShow all partitions registered on the system
cdGo to $HOME directory
cd -Go to previous directory
cdparanoia -BRip audio tracks from CD to wav files in current dir
cdrecord -v dev=/dev/cdrom -audio -pad *.wavMake audio CD from all wavs in current dir (see also cdrdao)
cdrecord -v dev=/dev/cdrom blank=fastClear a CDRW
date -d friWhat date is it this friday. See also day
date --date='@2147483647'Convert seconds since the epoch (1970-01-01 UTC) to date
date --date='25 Dec' +%AWhat day does xmas fall on, this year
date --date='TZ="America/Los_Angeles" 09:00 next Fri'What's the local time for 9AM next Friday on west coast US
dd bs=1 seek=2TB if=/dev/null of=ext3.testCreate a large test file (taking no space). See also truncate
dd bs=1M if=/dev/sda | gzip | ssh user@remote 'dd of=sda.gz'Backup harddisk to remote machine
df -hShow free space on mounted filesystems
df -iShow free inodes on mounted filesystems
dmidecode -q | lessDisplay SMBIOS/DMI information
dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1nList all packages by installed size (KBytes) on deb distros
du -hs /home/* | sort -k1,1hSort paths by easy to interpret disk usage
du -s * | sort -k1,1rn | headShow top disk users in current dir. See also dutop
echo "I live in `locale territory`"Extract info from locale database
echo $((0x2dec))Base conversion (hex to dec) ((shell arithmetic expansion))
echo '(1 + sqrt(5))/2' | bc -lQuick math (Calculate ?). See also bc
echo 'message' | smbclient -M windows_boxSend popup to windows machine (off by default in XP sp2)
echo -n 0x20AC | recode ucs-2/x2..latin-9/xShow latin-9 encoding
echo -n 0x20AC | recode ucs-2/x2..utf-8/xShow utf-8 encoding
echo -n 0x80 | recode latin-9/x1..dumpShow what a code represents in latin-9 charmap
echo 'obase=16; ibase=10; 64206' | bcBase conversion (decimal to hexadecimal)
echo 'pad=20; min=64; (100*10^6)/((pad+min)*8)' | bcMore complex (int) e.g. This shows max FastE packet rate
echo 'pad=20; min=64; print (100E6)/((pad+min)*8)' | pythonPython handles scientific notation
echo 'pad=20; plot [64:1518] (100*10**6)/((pad+x)*8)' | gnuplot -persistPlot FastE packet rate vs packet size
echo 'Test' | tr '[:lower:]' '[:upper:]'Case conversion
echo 'wget url' | at 01:00Download url at 1AM to current dir
ethtool eth0Show status of ethernet interface eth0
ethtool --change eth0 autoneg off speed 100 duplex fullManually set ethernet interface speed
fdisk -lShow disks partitions sizes and types (run as root)
find dir/ -name '*.txt' | tar -c --files-from=- | bzip2 > dir_txt.tar.bz2Make archive of subset of dir/ and below
find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parentsMake copy of subset of dir/ and below
find -maxdepth 1 -type d | while read dir; do echo $dir; echo cmd2; doneProcess each item with multiple commands (in while loop)
find -maxdepth 1 -type f | xargs grep -F 'example'Search all regular files for 'example' in this dir
find -name '*.[ch]' | xargs grep -E 'expr'Search 'expr' in this dir and below. See also findrepo
find -type d ! -perm -111Find dirs not accessible by all (useful for web site)
find -type f ! -perm -444Find files not readable by all (useful for web site)
find -type f -print0 | xargs -r0 grep -F 'example'Search all regular files for 'example' in this dir and below
free -mShow amount of (remaining) RAM (-m displays in MB)
gnuplotInteractive/scriptable graphing
gpg -c fileEncrypt file
gpg file.gpgDecrypt file
grep "model name" /proc/cpuinfoShow CPU(s) info
grep --color reference /usr/share/dict/wordsHighlight occurances of regular expression in dictionary
grep -F capacity: /proc/acpi/battery/BAT0/infoShow state of cells in laptop battery
grep MemTotal /proc/meminfoShow RAM total seen by the system
gzip < /dev/cdrom > cdrom.iso.gzSave copy of data cdrom
gzip -dc cdrom.iso.gz | cdrecord -v dev=/dev/cdrom -Burn cdrom image (use dev=ATAPI -scanbus to confirm dev)
hdparm -i /dev/sdaShow info about disk sda
hdparm -tT /dev/sdaDo a read speed test on disk sda
head -n1 /etc/issueShow name and version of distribution
history | wc -lCount lines
host pixelbeat.orgLookup DNS ip address for name or vice versa
hostname -iLookup local ip address (equivalent to host `hostname`)
ip addr add 1.2.3.4/24 brd + dev eth0Add (or del) ip and mask (255.255.255.0)
ip addr showList addresses for interfaces
ip link set dev eth0 name wanRename interface eth0 to wan
ip link set dev eth0 upBring interface eth0 up (or down)
ip link showList network interfaces
ip route add default via 1.2.3.254Set default gateway to 1.2.3.254
ip route showList routing table
iw dev wlan0 linkShow link status of wireless interface wlan0
iw dev wlan0 scanList wireless networks in range
iw dev wlan0 set bitrates legacy-2.4 1Manually set wireless interface speed
join -t'\0' -a1 -a2 file1 file2Union of sorted files
join -t'\0' file1 file2Intersection of sorted files
join -t'\0' -v1 -v2 file1 file2Symmetric Difference of sorted files
join -t'\0' -v2 file1 file2Difference of sorted files
LANG=en_IE.utf8 locale int_prefixLookup locale info for specific country. See also ccodes
last rebootShow system reboot history
linksWeb browser
locale -kc $(locale | sed -n 's/\(LC_.\{4,\}\)=.*/\1/p') | lessList fields available in locale database
locate -r 'file[^/]*\.txt'Search cached index for names. This re is like glob *file*.txt
look referenceQuickly search (sorted) dictionary for prefix
ls /usr/bin | pr -T9 -W$COLUMNSPrint in 9 columns to width of terminal
ls -lrtList files by date. See also newest and find_mm_yyyy
ls -lSrShow files by size, biggest last
lsof ~List processes that have specified path open
lsof -p $$List paths that process id has open
lspci -tvShow PCI info
lsusb -tvShow USB info
ltrace -f -e getenv ls >/dev/nullList library calls made by command
man -t ascii | ps2pdf - > ascii.pdfmake a pdf of a manual page
mcPowerful file manager that can browse rpm, tar, ftp, ssh, ...
mkisofs -V LABEL -r dir | gzip > cdrom.iso.gzCreate cdrom image from contents of dir
mount | column -tList mounted filesystems on the system (and align output)
mount -o loop cdrom.iso /mnt/dirMount the cdrom image at /mnt/dir (read only)
mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/shareMount a windows share
nmblookup -A 1.2.3.4Find the windows (netbios) name associated with ip address
oggenc --tracknum=$track track.cdda.wav -o track.oggMake ogg file from wav file
printf "%'d\n" 1234Print number with thousands grouping appropriate to locale
ps -C firefox-bin -L -o pid,tid,pcpu,stateList all threads for a particular process
ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d'List processes by % cpu usage
ps -e -o pid,args --forestList processes in a hierarchy
ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNSList processes by mem (KB) usage. See also ps_mem.py
ps -p 1,$$ -o etime=List elapsed wall time for particular process IDs
pushd .Put current dir on stack so you can popd back to it
readlineLine editor used by bash, python, bc, gnuplot, ...
recode ../b64 < file.txt > file.b64Base64 encode
recode ..HTML < file.txt > file.htmlText to HTML
recode /qp.. < file.qp > file.txtQuoted printable decode
recode iso-8859-15..utf8 file_to_change.txtLatin9 (western europe) to utf8
recode -l | lessShow available conversions (aliases on each line)
recode -lf windows-1252 | grep euroLookup table of characters
recode utf-8/CRLF.. file_to_change.txtWindows utf8 to local charset
recode windows-1252.. file_to_change.txtWindows "ansi" to local charset (auto does CRLF conversion)
rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1nList all packages by installed size (Bytes) on rpm distros
rsync -auz -e ssh remote:/dir/ . && rsync -auz -e ssh . remote:/dir/Synchronize current directory with remote one
rsync -az -e ssh -- ~/public_html/ remote.com:'~/public_html'Mirror web site (using compression and encryption)
rsync --bwlimit=1000 fromfile tofileLocally copy with rate limit. It's like nice for I/O
rsync -P rsync://rsync.server.com/path/to/file fileOnly get diffs. Do multiple times for troublesome downloads
scp -c arcfour $USER@$LANHOST: bigfileUse faster crypto for local LAN. This might saturate GigE
scp -p -r $USER@$HOST: file dir/Copy with permissions to $USER's home directory on $HOST
screenVirtual terminals with detach capability, ...
sed '/^ *#/d; /^ *$/d'Remove comments and blank lines
sed ':a; /\\$/N; s/\\\n//; ta'Concatenate lines with trailing \
sed -i 42d ~/.ssh/known_hostsDelete a particular line
sed -n '10,20p;20q'Print lines 10 to 20
sed -n '1000{p;q}'Print 1000th line
sed -n 's/.*\(.*\)<\/title>.*/\1/ip;T;q'</td><td>Extract title from HTML web page</td></tr> <tr><td>sed 's/[ \t]*$//'</td><td>Remove trailing spaces from lines</td></tr> <tr><td>sed 's/\(.*\)1/\12/g'</td><td>Modify anystring1 to anystring2</td></tr> <tr><td>sed 's/\([`"$\]\)/\\\1/g'</td><td>Escape shell metacharacters active within double quotes</td></tr> <tr><td>sed 's/string1/string2/g'</td><td>Replace string1 with string2</td></tr> <tr><td>seq 10 | paste -s -d ' '</td><td>Concatenate and separate line items to a single line</td></tr> <tr><td>seq 10 | sed "s/^/ /; s/ *\(.\{7,\}\)/\1/"</td><td>Right align numbers</td></tr> <tr><td>seq 10 | sed p | paste - -</td><td>Duplicate a column</td></tr> <tr><td>seq 100 | paste -s -d+ | bc</td><td>Add a column of numbers. See also add and funcpy</td></tr> <tr><td>seq -f '4/%g' 1 2 99999 | paste -sd-+ | bc -l</td><td>Calculate ? the unix way</td></tr> <tr><td>smartctl -A /dev/sda | grep Power_On_Hours</td><td>How long has this disk (system) been powered on in total</td></tr> <tr><td>smbclient -L windows_box</td><td>List shares on windows machine or samba server</td></tr> <tr><td>smbtree</td><td>Find windows machines. See also findsmb</td></tr> <tr><td>sort file1 file1 file2 | uniq -u</td><td>Difference of unsorted files</td></tr> <tr><td>sort file1 file2 | uniq</td><td>Union of unsorted files</td></tr> <tr><td>sort file1 file2 | uniq -d</td><td>Intersection of unsorted files</td></tr> <tr><td>sort file1 file2 | uniq -u</td><td>Symmetric Difference of unsorted files</td></tr> <tr><td>sort -t. -k1,1n -k2,2n -k3,3n -k4,4n</td><td>Sort IPV4 ip addresses</td></tr> <tr><td>ss -tup</td><td>List active connections to/from system</td></tr> <tr><td>ss -tupl</td><td>List internet services on a system</td></tr> <tr><td>ssh $USER@$HOST command</td><td>Run command on $HOST as $USER (default command=shell)</td></tr> <tr><td>ssh -f -Y $USER@$HOSTNAME xeyes</td><td>Run GUI command on $HOSTNAME as $USER</td></tr> <tr><td>ssh -g -L 8080:localhost:80 root@$HOST</td><td>Forward connections to $HOSTNAME:8080 out to $HOST:80</td></tr> <tr><td>ssh -R 1434:imap:143 root@$HOST</td><td>Forward connections from $HOST:1434 in to imap:143</td></tr> <tr><td>ssh-copy-id $USER@$HOST</td><td>Install public key for $USER@$HOST for password-less log in</td></tr> <tr><td>strace -c ls >/dev/null</td><td>Summarise/profile system calls made by command</td></tr> <tr><td>strace -f -e open ls >/dev/null</td><td>List system calls made by command</td></tr> <tr><td>strace -f -e trace=write -e write=1,2 ls >/dev/null</td><td>Monitor what's written to stdout and stderr</td></tr> <tr><td>tail -f /var/log/messages</td><td>Monitor messages in a log file</td></tr> <tr><td>tar -c dir/ | bzip2 > dir.tar.bz2</td><td>Make compressed archive of dir/</td></tr> <tr><td>tar -c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg'</td><td>Make encrypted archive of dir/ on remote machine</td></tr> <tr><td>tcpdump not port 22</td><td>Show network traffic except ssh. See also tcpdump_not_me</td></tr> <tr><td>time cat</td><td>Start stopwatch. Ctrl-d to stop. See also sw</td></tr> <tr><td>time command</td><td>See how long a command takes</td></tr> <tr><td>tr -dc '[:print:]' < /dev/urandom</td><td>Filter non printable characters</td></tr> <tr><td>tr -s '[:blank:]' '\t' </proc/diskstats | cut -f4</td><td>cut fields separated by blanks</td></tr> <tr><td>TZ='America/Los_Angeles' date</td><td>What time is it on west coast of US (use tz to find TZ)</td></tr> <tr><td>udevadm monitor</td><td>Monitor udev events to help configure rules</td></tr> <tr><td>uname -a</td><td>Show kernel version and system architecture</td></tr> <tr><td>units -t '1 googol'</td><td>Definition lookup</td></tr> <tr><td>units -t '100m/9.58s' 'miles/hour'</td><td>Unit conversion (metric to imperial)</td></tr> <tr><td>units -t '500GB' 'GiB'</td><td>Unit conversion (SI to IEC prefixes)</td></tr> <tr><td>watch -n.1 'cat /proc/interrupts'</td><td>Watch changeable data continuously</td></tr> <tr><td>wget -c http://www.example.com/large.file</td><td>Continue downloading a partially downloaded file</td></tr> <tr><td>wget ftp://remote/file[1-9].iso/</td><td>FTP supports globbing directly</td></tr> <tr><td>wget --limit-rate=20k url</td><td>Do a low priority download (limit to 20KB/s in this case)</td></tr> <tr><td>wget --mirror http://www.example.com/</td><td>Efficiently update a local copy of a site (handy from cron)</td></tr> <tr><td>wget -nv --spider --force-html -i bookmarks.html</td><td>Check links in a file</td></tr> <tr><td>wget -q -O- http://www.pixelbeat.org/timeline.html | grep 'a href' | head</td><td>Process output directly</td></tr> <tr><td>wget -r -nd -np -l1 -A '*.jpg' http://www.example.com/dir/</td><td>Download a set of files to the current directory</td></tr> <tr><td>which command</td><td>Show full path name of command</td></tr> <tr><td>whois pixelbeat.org</td><td>Lookup whois info for hostname or ip address</td></tr> <tr><td>xdg-open .</td><td>open a file or url with the registered desktop application</td></tr> </table> </div> <br/><h2 class="title">Comments and questions</h2><a name='newCom'></a><p style='color:#ff9900;font-size:14px;'></p><h2 class="title">Publish comment or question</h2> <form method='POST' action='#newCom'> <p> <div><label for="data_Name">Your name</label> </div> <input id='iName' type="text" name="data_Name" maxlength="70" value="" style="width:98%;padding:0;margin:0;"/> </p> <p> <div><label for="data_Message">Comment or question</label> </div> <textarea name="data_Message" maxlength="70000" rows="10" style="width:98%;padding:0;margin:0;"></textarea> </p> <div style='width:98%;'> <div> <label for="data_Defence">Form defence</label> </div> <select name="data_Defence" style="width:100%;"> <option value="-">Select right value please</option> <option value="r">I'm spam robot</option> <option value="+">I'm human</option> <option value="i">I'm not human</option> </select> <div class='zet'><input value="" type="text" name="dataNameField" /></div> </div> <p><input type="submit" class="button" name="submitComment" value="Publish" style="width:98%;"/></p> </form> </div> </div> </div> <!--[RIGHT COLUMN CONTAINER]--> <div id="right"> <div style="padding-left:15px;"> <div class="module"> <div class="logo"> <div style='text-align:center;'> <img alt="ELTASK.COM" src="/images/sh02.png" style="margin:0px;padding:0px;width:148px;height:193px;" /> </div> <div class="boxTop" style="margin:15px 0 0 0;"> More than 500`000 downloads and installations of our programs! We are play.google.com leader for the <a target="_blank" rel="nofollow" href="https://play.google.com/store/search?q=%D0%BC%D0%B5%D0%B4%D0%B8%D1%86%D0%B8%D0%BD%D1%81%D0%BA%D0%B8%D0%B9%20%D1%81%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA&c=apps">"медицинский справочник" ("medical handbook"/"medical guide" in russian)</a>, <a target="_blank" rel="nofollow" href="https://play.google.com/store/search?q=%D0%BC%D0%B5%D0%B4%D0%B8%D1%86%D0%B8%D0%BD%D1%81%D0%BA%D0%B8%D0%B9&c=apps">"медицинский" ("medical" in russian)</a>, <a target="_blank" rel="nofollow" href="https://play.google.com/store/search?q=%D1%8D%D0%BA%D1%81%D0%BF%D0%B5%D1%80%D1%82%D0%BD%D0%B0%D1%8F%20%D1%81%D0%B8%D1%81%D1%82%D0%B5%D0%BC%D0%B0&c=apps">"экспертная система" ("expert system" in russian)</a>, <a target="_blank" rel="nofollow" href="https://play.google.com/store/search?q=Украина законы&c=apps">Украина законы (Ukraine laws)</a>, <a target="_blank" rel="nofollow" href="https://play.google.com/store/search?q=Россия законы&c=apps">Россия законы (Russia laws)</a>, <a target="_blank" href="https://play.google.com/store/search?q=wifi дозиметр&c=apps">wifi дозиметр</a> search requests.</div> <div class="boxTop" style="margin:15px 0 0 0;"> We occupy the first lines in the google.com search engine for the next search requests: <a target="_blank" rel="nofollow" href="http://google.com/search?q=wifi+дозиметр">wifi дозиметр</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=wifi+dosimeter">wifi dosimeter</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=сигнализация+нейрон">сигнализация нейрон</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=neuron+alarm+system">neuron alarm system</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=универсальная+сигнализация">универсальная сигнализация</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=мобильная+экспертная+система">мобильная экспертная система</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=android+экспертная+система">android экспертная система</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=android+expert+system">android expert system</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=it+expert+system">it expert system</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=android+основные+законы">android основные законы</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=Украина+основные+законы">Украина основные законы</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=android+медицинский+справочник">android медицинский справочник</a>, <a target="_blank" rel="nofollow" href="http://google.com/search?q=медицина+экспертная+система">медицина экспертная система</a>... Our ELTASK.COM team is cited <a target="_blank" rel="nofollow" href="http://google.com/search?q=%22eltask.com%22"> approximately 10,000 times in the google.com search engine</a> and <a target="_blank" rel="nofollow" href="https://yandex.ru/search/?text=%22eltask.com%22"> approximately 11000 times in the yandex.ru search engine</a>. For these indicators, our small innovative team is superior to the huge number of IT companies with large capitals and large resources. </div> </div> </div> <div class="module"> <div class="module-title"> Recommend us in soc. networks </div> <div class="logo"> <div style='float:none;text-align:center;height:21px;line-height:21px;'><div style="text-align:center;"> <a rel='nofollow' target="_blank" href="http://www.facebook.com/sharer.php?u=http://eltask.com/en/i-140"><img src="/r/images/s/f.png" height="21px" width="21px"/></a>    <a rel='nofollow' target="_blank" href="http://vkontakte.ru/share.php?url=http://eltask.com/en/i-140"><img src="/r/images/s/v.png" height="21px" width="21px"/></a>    <a rel='nofollow' target="_blank" href="https://twitter.com/share?url=http://eltask.com/en/i-140"><img src="/r/images/s/t.png" height="21px" width="21px"/></a>    <a rel='nofollow' target="_blank" href="http://plus.google.com/share?url=http://eltask.com/en/i-140"><img src="/r/images/s/g.png" height="21px" width="21px"/></a> </div></div> </div> </div> <div class="module"> <div class="module-title"> Parameters of http-request </div> <div class="logo"> <p class='element'><strong>IP address:</strong> 54.234.228.78</p> <p class='element' style='text-align:justify;'><strong>User agent:</strong> CCBot/2.0 (https://commoncrawl.org/faq/)</p> <p class='element'><strong>Region:</strong> United States:Ashburn</p> <p class='element'><strong>Downloads: </strong> 5699602/464</p><p class='element'><strong>Delta: </strong> 0.04284</p> </div> </div> <div class="module"> <div class="logo" style="text-align:center;padding:1px;"> Site is created using ELTASK CMS.<br/> "Transparent company" template. </div> </div> </div> </div> </div> </div> <!--[-CONTENT CONTAINER]--> <div><div style="border-radius:5px;padding:3px;margin: 10px 0 0 0;text-align:center;border:solid 1px #8bf;color:#fff;background-color:rgba(5,15,205,0.22);"><div>Copyright 2018 © ELTASK.COM</div><div>All rights reserved.</div></div></div> </div> </div> </body> </html>