SlideShare a Scribd company logo
1 of 7
Download to read offline
freeworld.posterous.com




               Linux Bash Shell
                  Cheat Sheet

                          (works with about every distribution, except for apt-get which is Ubuntu/Debian exclusive)



Legend:

Everything in “<>” is to be replaced, ex: <fileName> --> iLovePeanuts.txt
Don't include the '=' in your commands
'..' means that more than one file can be affected with only one command ex: rm
file.txt file2.txt movie.mov .. ..
Linux Bash Shell Cheat Sheet
                                                                Basic Commands

Basic Terminal Shortcuts                                                                Basic file manipulation
CTRL L = Clear the terminal                                                             cat <fileName> = show content of file
CTRL D = Logout                                                                                      (less, more)
SHIFT Page Up/Down = Go up/down the terminal                                            head = from the top
CTRL A = Cursor to start of line                                                              -n <#oflines> <fileName>
CTRL E = Cursor the end of line
CTRL U = Delete left of the cursor                                                      tail = from the bottom
CTRL K = Delete right of the cursor                                                           -n <#oflines> <fileName>
CTRL W = Delete word on the left
CTRL Y = Paste (after CTRL U,K or W)                                                    mkdir = create new folder
TAB = auto completion of file or command                                                mkdir myStuff ..
CTRL R = reverse search history                                                         mkdir myStuff/pictures/ ..
!! = repeat last command
CTRL Z = stops the current command (resume with fg in foreground or bg in background)   cp image.jpg newimage.jpg = copy and rename a file
Basic Terminal Navigation                                                               cp   image.jpg <folderName>/ = copy to folder
                                                                                        cp   image.jpg folder/sameImageNewName.jpg
ls   -a = list all files and folders                                                    cp   -R stuff otherStuff = copy and rename a folder
ls   <folderName> = list files in folder                                                cp   *.txt stuff/ = copy all of *<file type> to folder
ls   -lh = Detailed list, Human readable
ls   -l *.jpg = list jpeg files only                                                    mv   file.txt Documents/ = move file to a folder
ls   -lh <fileName> = Result for file only                                              mv   <folderName> <folderName2> = move folder in folder
                                                                                        mv   filename.txt filename2.txt = rename file
cd <folderName> = change directory                                                      mv   <fileName> stuff/newfileName
      if folder name has spaces use “ “                                                 mv   <folderName>/ .. = move folder up in hierarchy
cd / = go to root
cd .. = go up one folder, tip: ../../../                                                rm   <fileName> .. = delete file (s)
                                                                                        rm   -i <fileName> .. = ask for confirmation each file
du -h: Disk usage of folders, human readable                                            rm   -f <fileName> = force deletion of a file
du -ah: “     “   “ files & folders, Human readable                                     rm   -r <foldername>/ = delete folder
du -sh: only show disc usage of folders
                                                                                        touch <fileName> = create or update a file
pwd = print working directory
                                                                                        ln file1 file2 = physical link
man <command> = shows manual (RTFM)                                                     ln -s file1 file2 = symbolic link
Linux Bash Shell Cheat Sheet
                                                       Basic Commands

Researching Files                                                       Extract, sort and filter data
The slow method (sometimes very slow):                                  grep <someText> <fileName> = search for text in file
                                                                              -i = Doesn't consider uppercase words
locate <text> = search the content of all the files                           -I = exclude binary files
locate <fileName> = search for a file                                   grep -r <text> <folderName>/ = search for file names
sudo updatedb = update database of files                                      with occurrence of the text

find   = the   best file search tool (fast)                             With regular expressions:
find   -name   “<fileName>”
find   -name   “text” = search for files who start with the word text   grep   -E ^<text> <fileName> = search start of lines
find   -name   “*text” = “      “     “    “  end   “    “   “    “     with   the word text
                                                                        grep   -E <0-4> <fileName> =shows lines containing numbers 0-4
Advanced Search:                                                        grep   -E <a-zA-Z> <fileName> = retrieve all lines
                                                                        with   alphabetical letters
Search from file Size (in ~)
      find ~ -size +10M = search files bigger than.. (M,K,G)            sort   = sort the content of files
                                                                        sort   <fileName> = sort alphabetically
Search from last access                                                 sort   -o <file> <outputFile> = write result to a file
      find -name “<filetype>” -atime -5                                 sort   -r <fileName> = sort in reverse
             ('-' = less than, '+' = more than and nothing = exactly)   sort   -R <fileName> = sort randomly
                                                                        sort   -n <fileName> = sort numbers
Search only files or directory’s
      find -type d --> ex: find /var/log -name "syslog" -type d         wc = word count
      find -type f = files                                              wc <fileName> = nbr of line, nbr of words, byte size
                                                                              -l (lines), -w (words), -c (byte size), -m
More info: man find, man locate                                               (number of characters)

                                                                        cut = cut a part of a file
                                                                        -c --> ex: cut -c 2-5 names.txt
                                                                              (cut the characters 2 to 5 of each line)
                                                                        -d (delimiter)         (-d & -f good for .csv files)
                                                                        -f (# of field to cut)

                                                                        more info: man cut, man sort, man grep
Linux Bash Shell Cheat Sheet
                                                   Basic Commands

Time settings                                                    (continued)
date = view & modify time (on your computer)                     crontab = execute a command regularly
                                                                       -e = modify the crontab
View:                                                                  -l = view current crontab
      date “+%H” --> If it's 9 am, then it will show 09                -r = delete you crontab
      date “+%H:%M:%Ss” = (hours, minutes, seconds)              In crontab the syntax is
      %Y = years                                                 <Minutes> <Hours> <Day of month> <Day of week (0-6,
Modify:                                                          0 = Sunday)> <COMMAND>
               MMDDhhmmYYYY
      Month | Day | Hours | Minutes | Year                       ex, create the file movies.txt every day at 15:47:
                                                                 47 15 * * * touch /home/bob/movies.txt
sudo date 031423421997 = March 14 th 1997, 23:42                 * * * * * --> every minute
                                                                 at 5:30 in the morning, from the 1st to 15th each month:
Execute programs at another time                                 30 5 1-15 * *
                                                                 at midnight on Mondays, Wednesdays and Thursdays:
use 'at' to execute programs in the future                       0 0 * * 1,3,4
                                                                 every two hours:
Step 1, write in the terminal: at <timeOfExecution> ENTER        0 */2 * * *
ex --> at 16:45 or at 13:43 7/23/11 (to be more precise)         every 10 minutes Monday to Friday:
or after a certain delay:                                        */10 * * * 1-5
      at now +5 minutes (hours, days, weeks, months, years)
Step 2: <ENTER COMMAND> ENTER                                    Execute programs in the background
      repeat step 2 as many times you need
Step 3: CTRL D to close input                                    Add a '&' at the end of a command
                                                                       ex --> cp bigMovieFile.mp4 &
atq = show a list of jobs waiting to be executed
                                                                 nohup: ignores the HUP signal when closing the console
atrm = delete a job n°<x>                                        (process will still run if the terminal is closed)
ex (delete job #42) --> atrm 42                                        ex --> nohup cp bigMovieFile.mp4

sleep = pause between commands                                   jobs = know what is running in the background
      with ';' you can chain commands, ex: touch file; rm file
you can make a pause between commands (minutes, hours, days)     fg = put a background process to foreground
ex --> touch file; sleep 10; rm file <-- 10 seconds                    ex: fg (process 1), f%2 (process 2) f%3, ...
Linux Bash Shell Cheat Sheet
                                                    Basic Commands

Process Management                                               Create and modify user accounts
w = who is logged on and what they are doing                     sudo adduser bob = root creates new user
                                                                 sudo passwd <AccountName> = change a user's password
tload = graphic representation of system load average            sudo deluser <AccountName> = delete an account
      (quit with CTRL C)
                                                                 addgroup friends = create a new user group
ps = Static process list                                         delgroup friends = delete a user group
      -ef --> ex: ps -ef | less
      -ejH --> show process hierarchy                            usermod -g friends <Account> = add user to a group
      -u --> process's from current user                         usermod -g bob boby = change account name
                                                                 usermod -aG friends bob = add groups to a user with-
top = Dynamic process list                                       out loosing the ones he's already in
While in top:
         •   q to close top                                      File Permissions
         •   h to show the help
         •   k to kill a process                                 chown = change the owner of a file
                                                                       ex --> chown bob hello.txt
CTRL C to top a current terminal process                         chown user:bob report.txt = changes the user owning
                                                                 report.txt to 'user' and the group owning it to 'bob'
kill = kill a process                                            -R = recursively affect all the sub folders
      You need the PID # of the process                                ex --> chown -R bob:bob /home/Daniel
             ps -u <AccountName> | grep <Application>
      Then                                                       chmod =   modify user access/permission – simple way
             kill <PID> .. .. ..                                       u   = user
kill -9 <PID> = violent kill                                           g   = group
                                                                       o   = other
killall = kill multiple process's
      ex --> killall locate                                            d = directory (if element is a directory)
                                                                       l = link (if element is a file link)
extras:                                                                r = read (read permissions)
      sudo halt <-- to close computer                                  w = write (write permissions)
      sudo reboot <-- to reboot                                        x = eXecute (only useful for scripts and
                                                                       programs)
Linux Bash Shell Cheat Sheet
                                                        Basic Commands

File Permissions (continued)                                         Flow Redirection (continued)
'+' means add a right                                                terminal output:
'-' means delete a right                                             Alex
'=' means affect a right                                             Cinema
                                                                     Code
ex --> chmod g+w someFile.txt                                        Game
      (add to current group the right to modify someFile.txt)        Ubuntu

more info: man chmod                                                        Another example --> wc -m << END

Flow redirection                                                     Chain commands
Redirect results of commands:                                        '|' at the end of a command to enter another one
                                                                           ex --> du | sort -nr | less
'>' at the end of a command to redirect the result to a file
      ex --> ps -ejH > process.txt                                   Archive and compress data
'>>' to redirect the result to the end of a file
                                                                     Archive and compress data the long way:
Redirect errors:
                                                                     Step 1, put all the files you want to compress in
'2>' at the end of the command to redirect the result to a file      the same folder: ex --> mv *.txt folder/
      ex --> cut -d , -f 1 file.csv > file 2> errors.log
'2>&1' to redirect the errors the same way as the standard output    Step 2, Create the tar file:
                                                                     tar -cvf my_archive.tar folder/
Read progressively from the keyboard                                       -c : creates a .tar archive
                                                                           -v : tells you what is happening (verbose)
<Command> << <wordToTerminateInput>                                        -f : assembles the archive into one file
      ex --> sort << END <-- This can be anything you want
             >   Hello                                                       Step 3.1, create gzip file (most current):
             >   Alex                                                gzip my_archive.tar
             >   Cinema                                                      to decompress: gunzip my_archive.tar.gz
             >   Game
             >   Code                                                Step 3.2, or create a bzip2 file (more powerful but slow):
             >   Ubuntu                                              bzip2 my_archive.tar
             >   END                                                         to decompress: bunzip2 my_archive.tar.bz2
Linux Bash Shell Cheat Sheet
                                                      Basic Commands

Archive and compress data (continued)                                 Installing software
step 4, to decompress the .tar file:                                  When software is available in the repositories:
       tar -xvf archive.tar archive.tar                               sudo apt-get install <nameOfSoftware>
                                                                            ex--> sudo apt-get install aptitude
Archive and compress data the fast way:
                                                                      If you download it from the Internets in .gz format
gzip: tar -zcvf my_archive.tar.gz folder/                             (or bz2) - “Compiling from source”
      decompress: tar -zcvf my_archive.tar.gz Documents/              Step 1, create a folder to place the file:
                                                                            mkdir /home/username/src <-- then cd to it
bzip2: tar -jcvf my_archive.tar.gz folder/
      decompress: tar -jxvf archive.tar.bz2 Documents/                Step 2, with 'ls' verify that the file is there
                                                                      (if not, mv ../file.tar.gz /home/username/src/)
Show the content of .tar, .gz or .bz2     without decompressing it:
                                                                      Step 3, decompress the file (if .zip: unzip <file>)
gzip:                                                                 <--
         gzip -ztf archive.tar.gz                                     Step 4, use 'ls', you should see a new directory
bzip2:                                                                Step 5, cd to the new directory
         bzip2 -jtf archive.tar.bz2                                   Step 6.1, use ls to verify you have an INSTALL file,
tar:                                                                  then: more INSTALL
         tar -tf archive.tar                                          If you don't have an INSTALL file:
                                                                      Step 6.2, execute ./configure <-- creates a makefile
tar extra:                                                            Step 6.2.1, run make <-- builds application binaries
      tar -rvf archive.tar file.txt = add a file to the .tar          Step 6.2.2 : switch to root --> su
                                                                      Step 6.2.3 : make install <-- installs the software
You can also directly compress a single file and view the file        Step 7, read the readme file
without decompressing:

Step 1, use gzip or bzip2 to compress the file:
      gzip numbers.txt

Step 2, view the file without decompressing it:
      zcat = view the entire file in the console (same as cat)
      zmore = view one screen at a time the content of the file (same as more)
      zless = view one line of the file at a time (same as less)

More Related Content

What's hot

Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Ahmed El-Arabawy
 
[PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list [PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list nisivaasdfghj
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in LinuxSAMUEL OJO
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux Harish R
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell ScriptingRaghu nath
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examplesabclearnn
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Ahmed El-Arabawy
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigationhetaldobariya
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file systemTaaanu01
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command LineAnuchit Chalothorn
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)Rodrigo Maia
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & CommandsMohit Belwal
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheetWe Ihaveapc
 

What's hot (20)

Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files Course 102: Lecture 24: Archiving and Compression of Files
Course 102: Lecture 24: Archiving and Compression of Files
 
[PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list [PDF] 2021 Termux basic commands list
[PDF] 2021 Termux basic commands list
 
User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Bash Shell Scripting
Bash Shell ScriptingBash Shell Scripting
Bash Shell Scripting
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Linux basic commands with examples
Linux basic commands with examplesLinux basic commands with examples
Linux basic commands with examples
 
Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
 
Linux
Linux Linux
Linux
 
Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
50 most frequently used unix linux commands (with examples)
50 most frequently used unix   linux commands (with examples)50 most frequently used unix   linux commands (with examples)
50 most frequently used unix linux commands (with examples)
 
Linux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell ScriptingLinux systems - Linux Commands and Shell Scripting
Linux systems - Linux Commands and Shell Scripting
 
Unix OS & Commands
Unix OS & CommandsUnix OS & Commands
Unix OS & Commands
 
Basics of shell programming
Basics of shell programmingBasics of shell programming
Basics of shell programming
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
 

Similar to Linux Bash Shell Cheat Sheet for Beginners

Bash cheat sheet
Bash cheat sheetBash cheat sheet
Bash cheat sheetJogesh Rao
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1Leandro Lima
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overviewAmeer Sameer
 
Treebeard's Unix Cheat Sheet
Treebeard's Unix Cheat SheetTreebeard's Unix Cheat Sheet
Treebeard's Unix Cheat Sheetwensheng wei
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdfGiovaRossi
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Ranjan Raja
 
Lesson 3 Working with Files in Linux
Lesson 3 Working with Files in LinuxLesson 3 Working with Files in Linux
Lesson 3 Working with Files in LinuxSadia Bashir
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
 
Coming Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix ShellsComing Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix ShellsKel Cecil
 
Internal commands of dos
Internal commands of dosInternal commands of dos
Internal commands of dosNargiskhan786
 
Unix command
Unix commandUnix command
Unix commandAtul Pant
 

Similar to Linux Bash Shell Cheat Sheet for Beginners (20)

Bash cheat sheet
Bash cheat sheetBash cheat sheet
Bash cheat sheet
 
Bash cheat sheet
Bash cheat sheetBash cheat sheet
Bash cheat sheet
 
Linux cheat sheet
Linux cheat sheetLinux cheat sheet
Linux cheat sheet
 
Directories description
Directories descriptionDirectories description
Directories description
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
Common linux ubuntu commands overview
Common linux  ubuntu commands overviewCommon linux  ubuntu commands overview
Common linux ubuntu commands overview
 
Unix lab manual
Unix lab manualUnix lab manual
Unix lab manual
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Treebeard's Unix Cheat Sheet
Treebeard's Unix Cheat SheetTreebeard's Unix Cheat Sheet
Treebeard's Unix Cheat Sheet
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
unix_ref_card.pdf
unix_ref_card.pdfunix_ref_card.pdf
unix_ref_card.pdf
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja Linux Command Line - By Ranjan Raja
Linux Command Line - By Ranjan Raja
 
Lesson 3 Working with Files in Linux
Lesson 3 Working with Files in LinuxLesson 3 Working with Files in Linux
Lesson 3 Working with Files in Linux
 
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS: Introduction to Linux - Text manipulation tools for bioinformatics
BITS: Introduction to Linux - Text manipulation tools for bioinformatics
 
Coming Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix ShellsComing Out Of Your Shell - A Comparison of *Nix Shells
Coming Out Of Your Shell - A Comparison of *Nix Shells
 
Python programming : Files
Python programming : FilesPython programming : Files
Python programming : Files
 
Internal commands of dos
Internal commands of dosInternal commands of dos
Internal commands of dos
 
Unix command
Unix commandUnix command
Unix command
 

More from Davide Ciambelli

SEMrush SEO Fundamentals Exam
SEMrush SEO Fundamentals ExamSEMrush SEO Fundamentals Exam
SEMrush SEO Fundamentals ExamDavide Ciambelli
 
Google Analytics for Beginners
Google Analytics for BeginnersGoogle Analytics for Beginners
Google Analytics for BeginnersDavide Ciambelli
 
Advanced Google Analytics
Advanced Google Analytics Advanced Google Analytics
Advanced Google Analytics Davide Ciambelli
 
Ecommerce Analytics: From Data to Decision
Ecommerce Analytics: From Data to DecisionEcommerce Analytics: From Data to Decision
Ecommerce Analytics: From Data to DecisionDavide Ciambelli
 
Google Tag Manager Fundamentals
Google Tag Manager Fundamentals Google Tag Manager Fundamentals
Google Tag Manager Fundamentals Davide Ciambelli
 
Abilitazione all'utilizzo dei dispositivi DAE
Abilitazione all'utilizzo dei dispositivi DAEAbilitazione all'utilizzo dei dispositivi DAE
Abilitazione all'utilizzo dei dispositivi DAEDavide Ciambelli
 
Google Tag Manager Fundamentals
Google Tag Manager FundamentalsGoogle Tag Manager Fundamentals
Google Tag Manager FundamentalsDavide Ciambelli
 
Un viaggio chiamato LibreUmbria
Un viaggio chiamato LibreUmbriaUn viaggio chiamato LibreUmbria
Un viaggio chiamato LibreUmbriaDavide Ciambelli
 
Guida introduttiva di Google all’ottimizzazione per motori di ricerca (SEO)
Guida introduttiva di Google  all’ottimizzazione per motori di ricerca (SEO)Guida introduttiva di Google  all’ottimizzazione per motori di ricerca (SEO)
Guida introduttiva di Google all’ottimizzazione per motori di ricerca (SEO)Davide Ciambelli
 
Google analytics platform principles certificate
Google analytics platform principles certificateGoogle analytics platform principles certificate
Google analytics platform principles certificateDavide Ciambelli
 
Social Network Analysis for Journalists Using the Twitter API
Social Network Analysis for Journalists Using the Twitter APISocial Network Analysis for Journalists Using the Twitter API
Social Network Analysis for Journalists Using the Twitter APIDavide Ciambelli
 
Dharma Initiative pass card
Dharma Initiative pass cardDharma Initiative pass card
Dharma Initiative pass cardDavide Ciambelli
 
Qnap turbo nas hardware manual
Qnap turbo nas hardware manualQnap turbo nas hardware manual
Qnap turbo nas hardware manualDavide Ciambelli
 
Z750 manuale di assemblaggio
Z750 manuale di assemblaggioZ750 manuale di assemblaggio
Z750 manuale di assemblaggioDavide Ciambelli
 
The 2009 Simulated Car Racing Championship
The 2009 Simulated Car Racing ChampionshipThe 2009 Simulated Car Racing Championship
The 2009 Simulated Car Racing ChampionshipDavide Ciambelli
 

More from Davide Ciambelli (20)

SEMrush SEO Toolkit Exam
SEMrush SEO Toolkit ExamSEMrush SEO Toolkit Exam
SEMrush SEO Toolkit Exam
 
SEMrush SEO Fundamentals Exam
SEMrush SEO Fundamentals ExamSEMrush SEO Fundamentals Exam
SEMrush SEO Fundamentals Exam
 
Google Analytics for Beginners
Google Analytics for BeginnersGoogle Analytics for Beginners
Google Analytics for Beginners
 
Advanced Google Analytics
Advanced Google Analytics Advanced Google Analytics
Advanced Google Analytics
 
Ecommerce Analytics: From Data to Decision
Ecommerce Analytics: From Data to DecisionEcommerce Analytics: From Data to Decision
Ecommerce Analytics: From Data to Decision
 
Google Tag Manager Fundamentals
Google Tag Manager Fundamentals Google Tag Manager Fundamentals
Google Tag Manager Fundamentals
 
Eccellenze in digitale
Eccellenze in digitaleEccellenze in digitale
Eccellenze in digitale
 
Abilitazione all'utilizzo dei dispositivi DAE
Abilitazione all'utilizzo dei dispositivi DAEAbilitazione all'utilizzo dei dispositivi DAE
Abilitazione all'utilizzo dei dispositivi DAE
 
Google Tag Manager Fundamentals
Google Tag Manager FundamentalsGoogle Tag Manager Fundamentals
Google Tag Manager Fundamentals
 
Certificazione AdWords
Certificazione AdWordsCertificazione AdWords
Certificazione AdWords
 
Un viaggio chiamato LibreUmbria
Un viaggio chiamato LibreUmbriaUn viaggio chiamato LibreUmbria
Un viaggio chiamato LibreUmbria
 
Guida introduttiva di Google all’ottimizzazione per motori di ricerca (SEO)
Guida introduttiva di Google  all’ottimizzazione per motori di ricerca (SEO)Guida introduttiva di Google  all’ottimizzazione per motori di ricerca (SEO)
Guida introduttiva di Google all’ottimizzazione per motori di ricerca (SEO)
 
Il codice da lopins
Il codice da lopinsIl codice da lopins
Il codice da lopins
 
Google analytics platform principles certificate
Google analytics platform principles certificateGoogle analytics platform principles certificate
Google analytics platform principles certificate
 
Social Network Analysis for Journalists Using the Twitter API
Social Network Analysis for Journalists Using the Twitter APISocial Network Analysis for Journalists Using the Twitter API
Social Network Analysis for Journalists Using the Twitter API
 
Dharma Initiative pass card
Dharma Initiative pass cardDharma Initiative pass card
Dharma Initiative pass card
 
Dossier Dharma Initiative
Dossier Dharma InitiativeDossier Dharma Initiative
Dossier Dharma Initiative
 
Qnap turbo nas hardware manual
Qnap turbo nas hardware manualQnap turbo nas hardware manual
Qnap turbo nas hardware manual
 
Z750 manuale di assemblaggio
Z750 manuale di assemblaggioZ750 manuale di assemblaggio
Z750 manuale di assemblaggio
 
The 2009 Simulated Car Racing Championship
The 2009 Simulated Car Racing ChampionshipThe 2009 Simulated Car Racing Championship
The 2009 Simulated Car Racing Championship
 

Recently uploaded

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 

Linux Bash Shell Cheat Sheet for Beginners

  • 1. freeworld.posterous.com Linux Bash Shell Cheat Sheet (works with about every distribution, except for apt-get which is Ubuntu/Debian exclusive) Legend: Everything in “<>” is to be replaced, ex: <fileName> --> iLovePeanuts.txt Don't include the '=' in your commands '..' means that more than one file can be affected with only one command ex: rm file.txt file2.txt movie.mov .. ..
  • 2. Linux Bash Shell Cheat Sheet Basic Commands Basic Terminal Shortcuts Basic file manipulation CTRL L = Clear the terminal cat <fileName> = show content of file CTRL D = Logout (less, more) SHIFT Page Up/Down = Go up/down the terminal head = from the top CTRL A = Cursor to start of line -n <#oflines> <fileName> CTRL E = Cursor the end of line CTRL U = Delete left of the cursor tail = from the bottom CTRL K = Delete right of the cursor -n <#oflines> <fileName> CTRL W = Delete word on the left CTRL Y = Paste (after CTRL U,K or W) mkdir = create new folder TAB = auto completion of file or command mkdir myStuff .. CTRL R = reverse search history mkdir myStuff/pictures/ .. !! = repeat last command CTRL Z = stops the current command (resume with fg in foreground or bg in background) cp image.jpg newimage.jpg = copy and rename a file Basic Terminal Navigation cp image.jpg <folderName>/ = copy to folder cp image.jpg folder/sameImageNewName.jpg ls -a = list all files and folders cp -R stuff otherStuff = copy and rename a folder ls <folderName> = list files in folder cp *.txt stuff/ = copy all of *<file type> to folder ls -lh = Detailed list, Human readable ls -l *.jpg = list jpeg files only mv file.txt Documents/ = move file to a folder ls -lh <fileName> = Result for file only mv <folderName> <folderName2> = move folder in folder mv filename.txt filename2.txt = rename file cd <folderName> = change directory mv <fileName> stuff/newfileName if folder name has spaces use “ “ mv <folderName>/ .. = move folder up in hierarchy cd / = go to root cd .. = go up one folder, tip: ../../../ rm <fileName> .. = delete file (s) rm -i <fileName> .. = ask for confirmation each file du -h: Disk usage of folders, human readable rm -f <fileName> = force deletion of a file du -ah: “ “ “ files & folders, Human readable rm -r <foldername>/ = delete folder du -sh: only show disc usage of folders touch <fileName> = create or update a file pwd = print working directory ln file1 file2 = physical link man <command> = shows manual (RTFM) ln -s file1 file2 = symbolic link
  • 3. Linux Bash Shell Cheat Sheet Basic Commands Researching Files Extract, sort and filter data The slow method (sometimes very slow): grep <someText> <fileName> = search for text in file -i = Doesn't consider uppercase words locate <text> = search the content of all the files -I = exclude binary files locate <fileName> = search for a file grep -r <text> <folderName>/ = search for file names sudo updatedb = update database of files with occurrence of the text find = the best file search tool (fast) With regular expressions: find -name “<fileName>” find -name “text” = search for files who start with the word text grep -E ^<text> <fileName> = search start of lines find -name “*text” = “ “ “ “ end “ “ “ “ with the word text grep -E <0-4> <fileName> =shows lines containing numbers 0-4 Advanced Search: grep -E <a-zA-Z> <fileName> = retrieve all lines with alphabetical letters Search from file Size (in ~) find ~ -size +10M = search files bigger than.. (M,K,G) sort = sort the content of files sort <fileName> = sort alphabetically Search from last access sort -o <file> <outputFile> = write result to a file find -name “<filetype>” -atime -5 sort -r <fileName> = sort in reverse ('-' = less than, '+' = more than and nothing = exactly) sort -R <fileName> = sort randomly sort -n <fileName> = sort numbers Search only files or directory’s find -type d --> ex: find /var/log -name "syslog" -type d wc = word count find -type f = files wc <fileName> = nbr of line, nbr of words, byte size -l (lines), -w (words), -c (byte size), -m More info: man find, man locate (number of characters) cut = cut a part of a file -c --> ex: cut -c 2-5 names.txt (cut the characters 2 to 5 of each line) -d (delimiter) (-d & -f good for .csv files) -f (# of field to cut) more info: man cut, man sort, man grep
  • 4. Linux Bash Shell Cheat Sheet Basic Commands Time settings (continued) date = view & modify time (on your computer) crontab = execute a command regularly -e = modify the crontab View: -l = view current crontab date “+%H” --> If it's 9 am, then it will show 09 -r = delete you crontab date “+%H:%M:%Ss” = (hours, minutes, seconds) In crontab the syntax is %Y = years <Minutes> <Hours> <Day of month> <Day of week (0-6, Modify: 0 = Sunday)> <COMMAND> MMDDhhmmYYYY Month | Day | Hours | Minutes | Year ex, create the file movies.txt every day at 15:47: 47 15 * * * touch /home/bob/movies.txt sudo date 031423421997 = March 14 th 1997, 23:42 * * * * * --> every minute at 5:30 in the morning, from the 1st to 15th each month: Execute programs at another time 30 5 1-15 * * at midnight on Mondays, Wednesdays and Thursdays: use 'at' to execute programs in the future 0 0 * * 1,3,4 every two hours: Step 1, write in the terminal: at <timeOfExecution> ENTER 0 */2 * * * ex --> at 16:45 or at 13:43 7/23/11 (to be more precise) every 10 minutes Monday to Friday: or after a certain delay: */10 * * * 1-5 at now +5 minutes (hours, days, weeks, months, years) Step 2: <ENTER COMMAND> ENTER Execute programs in the background repeat step 2 as many times you need Step 3: CTRL D to close input Add a '&' at the end of a command ex --> cp bigMovieFile.mp4 & atq = show a list of jobs waiting to be executed nohup: ignores the HUP signal when closing the console atrm = delete a job n°<x> (process will still run if the terminal is closed) ex (delete job #42) --> atrm 42 ex --> nohup cp bigMovieFile.mp4 sleep = pause between commands jobs = know what is running in the background with ';' you can chain commands, ex: touch file; rm file you can make a pause between commands (minutes, hours, days) fg = put a background process to foreground ex --> touch file; sleep 10; rm file <-- 10 seconds ex: fg (process 1), f%2 (process 2) f%3, ...
  • 5. Linux Bash Shell Cheat Sheet Basic Commands Process Management Create and modify user accounts w = who is logged on and what they are doing sudo adduser bob = root creates new user sudo passwd <AccountName> = change a user's password tload = graphic representation of system load average sudo deluser <AccountName> = delete an account (quit with CTRL C) addgroup friends = create a new user group ps = Static process list delgroup friends = delete a user group -ef --> ex: ps -ef | less -ejH --> show process hierarchy usermod -g friends <Account> = add user to a group -u --> process's from current user usermod -g bob boby = change account name usermod -aG friends bob = add groups to a user with- top = Dynamic process list out loosing the ones he's already in While in top: • q to close top File Permissions • h to show the help • k to kill a process chown = change the owner of a file ex --> chown bob hello.txt CTRL C to top a current terminal process chown user:bob report.txt = changes the user owning report.txt to 'user' and the group owning it to 'bob' kill = kill a process -R = recursively affect all the sub folders You need the PID # of the process ex --> chown -R bob:bob /home/Daniel ps -u <AccountName> | grep <Application> Then chmod = modify user access/permission – simple way kill <PID> .. .. .. u = user kill -9 <PID> = violent kill g = group o = other killall = kill multiple process's ex --> killall locate d = directory (if element is a directory) l = link (if element is a file link) extras: r = read (read permissions) sudo halt <-- to close computer w = write (write permissions) sudo reboot <-- to reboot x = eXecute (only useful for scripts and programs)
  • 6. Linux Bash Shell Cheat Sheet Basic Commands File Permissions (continued) Flow Redirection (continued) '+' means add a right terminal output: '-' means delete a right Alex '=' means affect a right Cinema Code ex --> chmod g+w someFile.txt Game (add to current group the right to modify someFile.txt) Ubuntu more info: man chmod Another example --> wc -m << END Flow redirection Chain commands Redirect results of commands: '|' at the end of a command to enter another one ex --> du | sort -nr | less '>' at the end of a command to redirect the result to a file ex --> ps -ejH > process.txt Archive and compress data '>>' to redirect the result to the end of a file Archive and compress data the long way: Redirect errors: Step 1, put all the files you want to compress in '2>' at the end of the command to redirect the result to a file the same folder: ex --> mv *.txt folder/ ex --> cut -d , -f 1 file.csv > file 2> errors.log '2>&1' to redirect the errors the same way as the standard output Step 2, Create the tar file: tar -cvf my_archive.tar folder/ Read progressively from the keyboard -c : creates a .tar archive -v : tells you what is happening (verbose) <Command> << <wordToTerminateInput> -f : assembles the archive into one file ex --> sort << END <-- This can be anything you want > Hello Step 3.1, create gzip file (most current): > Alex gzip my_archive.tar > Cinema to decompress: gunzip my_archive.tar.gz > Game > Code Step 3.2, or create a bzip2 file (more powerful but slow): > Ubuntu bzip2 my_archive.tar > END to decompress: bunzip2 my_archive.tar.bz2
  • 7. Linux Bash Shell Cheat Sheet Basic Commands Archive and compress data (continued) Installing software step 4, to decompress the .tar file: When software is available in the repositories: tar -xvf archive.tar archive.tar sudo apt-get install <nameOfSoftware> ex--> sudo apt-get install aptitude Archive and compress data the fast way: If you download it from the Internets in .gz format gzip: tar -zcvf my_archive.tar.gz folder/ (or bz2) - “Compiling from source” decompress: tar -zcvf my_archive.tar.gz Documents/ Step 1, create a folder to place the file: mkdir /home/username/src <-- then cd to it bzip2: tar -jcvf my_archive.tar.gz folder/ decompress: tar -jxvf archive.tar.bz2 Documents/ Step 2, with 'ls' verify that the file is there (if not, mv ../file.tar.gz /home/username/src/) Show the content of .tar, .gz or .bz2 without decompressing it: Step 3, decompress the file (if .zip: unzip <file>) gzip: <-- gzip -ztf archive.tar.gz Step 4, use 'ls', you should see a new directory bzip2: Step 5, cd to the new directory bzip2 -jtf archive.tar.bz2 Step 6.1, use ls to verify you have an INSTALL file, tar: then: more INSTALL tar -tf archive.tar If you don't have an INSTALL file: Step 6.2, execute ./configure <-- creates a makefile tar extra: Step 6.2.1, run make <-- builds application binaries tar -rvf archive.tar file.txt = add a file to the .tar Step 6.2.2 : switch to root --> su Step 6.2.3 : make install <-- installs the software You can also directly compress a single file and view the file Step 7, read the readme file without decompressing: Step 1, use gzip or bzip2 to compress the file: gzip numbers.txt Step 2, view the file without decompressing it: zcat = view the entire file in the console (same as cat) zmore = view one screen at a time the content of the file (same as more) zless = view one line of the file at a time (same as less)