Linux Commands - Part 2

Linux command line reference for common operations (part 2).
Examples marked with are valid/safe to paste without modification into a terminal, so
you may want to keep a terminal window open while reading this so you can cut & paste.
All these commands have been tested both on Fedora and Ubuntu.

Linux Commands - part 2   Command Description   archives and compression     gpg -c file Encrypt file   gpg file.gpg Decrypt file   tar -c dir/ | bzip2 > dir.tar.bz2 Make compressed archive of dir/   bzip2 -dc dir.tar.bz2 | tar -x Extract archive (use gzip instead of bzip2 for tar.gz files)   tar -c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg' Make encrypted archive of dir/ on remote machine   find dir/ -name '*.txt' | tar -c --files-from=- | bzip2 > dir_txt.tar.bz2 Make archive of subset of dir/ and below   find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parents Make copy of subset of dir/ and below   ( tar -c /dir/to/copy ) | ( cd /where/to/ && tar -x -p ) Copy (with permissions) copy/ dir to /where/to/ dir   ( 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 ) | ssh -C user@remote 'cd /where/to/ && tar -x -p' Copy (with permissions) copy/ dir to remote:/where/to/ dir   dd bs=1M if=/dev/sda | gzip | ssh user@remote 'dd of=sda.gz' Backup harddisk to remote machine   rsync (Network efficient file copier: Use the --dry-run option for testing)     rsync -P rsync://rsync.server.com/path/to/file file Only get diffs. Do multiple times for troublesome downloads   rsync --bwlimit=1000 fromfile tofile Locally copy with rate limit. It's like nice for I/O   rsync -az -e ssh --delete ~/public_html/ remote.com:'~/public_html' Mirror web site (using compression and encryption)   rsync -auz -e ssh remote:/dir/ . && rsync -auz -e ssh . remote:/dir/ Synchronize current directory with remote one   ssh (Secure SHell)     ssh $USER@$HOST command Run command on $HOST as $USER (default command=shell) • ssh -f -Y $USER@$HOSTNAME xeyes Run GUI command on $HOSTNAME as $USER   scp -p -r $USER@$HOST: file dir/ Copy with permissions to $USER's home directory on $HOST   ssh -g -L 8080:localhost:80 root@$HOST Forward connections to $HOSTNAME:8080 out to $HOST:80   ssh -R 1434:imap:143 root@$HOST Forward connections from $HOST:1434 in to imap:143   wget (multi purpose download tool)   • (cd cli && wget -nd -pHEKk http://www.it.toata.info) Store local browsable version of a page to the current dir   wget -c http://www.example.com/large.file Continue downloading a partially downloaded file   wget -r -nd -np -l1 -A '*.jpg' http://www.example.com/dir/ Download a set of files to the current directory   wget ftp://remote/file[1-9].iso/ FTP supports globbing directly • wget -q -O- http://www.example.com/timeline.html | grep 'a href' | head Process output directly   echo 'wget url' | at 01:00 Download url at 1AM to current dir   wget --limit-rate=20k url Do a low priority download (limit to 20KB/s in this case)   wget -nv --spider --force-html -i bookmarks.html Check links in a file   wget --mirror http://www.example.com/ Efficiently update a local copy of a site (handy from cron)

Part 1 of Linux Commands


Sursa
2009-02-21 19:07:41



Comenteaza





Ultimele 25 posturi adăugate

05:33:19DIN YES-EURI —» Leo Butnaru
20:42:41Unde suntem, încotro mergem —» APort | "Pentru un român care știe citi, cel mai greu lucru e să nu scrie." I.L. Carag
17:14:03Peste 1 miliard de euro în noi parteneriate investiționale și finanțări anunțate pentru Republica Moldova 💥 —» Sandu GRECU
11:26:32Potîrniche, acid cu colegii: birocrație. Stop pe Stadion. Rușinea CNOS. Sfaturi de la Dobrik —» Sandu GRECU
10:31:49Terapie în grup sau să nu ne mai mințim… —» Biblioteca de Arte 'Tudor Arghezi'
07:04:13Epicrama a fost inaugurată oficial —» Fine Wine
07:02:26Drumul Republicii Moldova în UE —» Biblioteca Publică or.Rîşcani
05:24:25DIN ESEURI —» Leo Butnaru
16:09:58Produsele moldovenești pot ajunge în fața cumpărătorilor internaționali la SIAL Paris 2026 ❣️ —» Sandu GRECU
16:01:52Tinerii din Moldova transformă apicultura într-o oportunitate de dezvoltare și investiție în viitor 🐝 —» Sandu GRECU
14:00:30Deputatul Lilian Carp cere transparență la Strășeni: Stadionul construit din bani publici trebuie să aparțină cetățenilor, nu grupurilor de interese 🔥 —» Sandu GRECU
07:56:28CELEBRITĂȚI PRIN VREMURI... —» Leo Butnaru
14:53:05Republica Moldova, destinație strategică pentru afaceri - Agenția de Investiții lansează Ghidul Investitorului 2026 📜 —» Sandu GRECU
12:12:31POEZII PENTRU COPII —» Leo Butnaru
09:12:46DE ZIUA COPIILOR —» Leo Butnaru
15:11:33Teatrul Verde și-a redeschis pe 29 mai stagiunea de vară printr-un spectacol grandios la Chișinău —» Curaj.TV | Media alternativă
05:55:34INTERSECȚII —» Leo Butnaru
23:39:40Skream & Benga reunited —» turn up the silence
09:06:42Rusia atacă România cu milioane de droni! —» APort | "Pentru un român care știe citi, cel mai greu lucru e să nu scrie." I.L. Carag
05:15:22LAPTE CU LITERE —» Leo Butnaru
16:50:14La întâlnire cu opera lui Constantin Brâncuși —» Biblioteca de Arte 'Tudor Arghezi'
15:03:28„Fii AgriCOOLtor!”: Cum transformă tinerii tradiția vinului moldovenesc într-o carieră de succes 🍷🍷 —» Sandu GRECU
14:38:17Companiile moldovenești pot accesa noi parteneriate de business în BENELUX. Înregistrările pentru Forumul de afaceri BENELUX-Republica Moldova sunt deschise până pe 4 iunie 💲 —» Sandu GRECU
07:14:03JURNALUL LUI ORFEU —» Leo Butnaru
16:31:29Marşul tăcerii pentru victimele pe bicicletă —» Curaj.TV | Media alternativă