SlideShare a Scribd company logo
1 of 40
Common Linux Ubuntu Commands Overview
Prepared by: Ameer Sameer Hamood
University of Babylon - Iraq
Information Technology - Information Networks
System Information
 pwd
Print working directory, i.e., display the name of my current directory on
the screen.
 hostname
Print the name of the local host (the machine on which you are working).
Use netconf (as root) to change the name of the machine.
 id username
Print user id (uid) and his/her group id (gid), effective id (if different than
the real id) and the supplementary groups.
 date
Print or change the operating system date and time. E.g., I could change
the date and time to 2000-12-31 23:57 using this command:
date 123123572000
To set the hardware (BIOS) clock from the system (Linux) clock, use the
command (as root) setclock
 who
Determine the users logged on the machine.
 finger user_name
System info about a user. Try: finger root . displays the user's login name,
real name, terminal name and write status (as a ``*'' after the terminal
name if write permission is denied), idle time, login time, office location .
 history | more
Show the last (1000 or so) commands executed from the command line
on the current account. The "| more" causes the display to stop after each
screenful.
System Information
Basic operations
 any_command --help |more
Display a brief help on a command (works with most commands). "--help"
works similar to DOS "/h" switch. The "more" pipe is needed if the output
is longer than one screen.
 man topic
Display the contents of the system manual pages (help) on the topic.
 Info topic
 information pages, which are generally more in-depth than man pages.
List Command
 ls - Short listing of directory contents
 -a list hidden files
 -d list the name of the current directory
 -F show directories with a trailing '/'
 executable files with a trailing '*'
 -g show group ownership of file in long listing
 -i print the inode number of each file
 -l long listing giving details about files and directories
 -R list all subdirectories encountered
 -t sort by time modified instead of name
Copy files
 cp file1 file2
 or
 cp myfile yourfile
 Copy the files "myfile" to the file "yourfile" in the current working
directory. This command will create the file "yourfile" if it doesn't exist. It
will normally overwrite it without warning if it exists.
 cp -i myfile yourfile
 With the "-i" option, if the file "yourfile" exists, you will be prompted
before it is overwritten.
 mv source destination
Move or rename files. The same command is used for moving and
renaming files and directories. Ex: mv testdir newnamedir
 rm files
Remove (delete) files. You must own the file in order to be able to remove
it. On many systems, you will be asked or confirmation of deleation, if you
don't want this, use the "-f" (=force) option, e.g., rm -f * will remove all
files in my current working directory, no questions asked.
 mkdir directory
Make a new directory.
 rmdir directory
Remove an empty directory.
 rm -r files
(recursive remove) Remove files, directories, and their subdirectories.
Careful with this command as root--you can easily remove all files on the
system with such a command executed on the top of your directory tree,
and there is no undelete in Linux (yet). But if you really wanted to do it
(reconsider), here is how (as root): rm -rf /*
Copy files
 cat filename
 View the content of a text file called "filename"
 find / -name filename
Find the file called "filename" on your file system starting the search from
the root directory "/". The "filename" may contain wildcards (*,?).ex:
find / -name "file.text"
 locate filename
Find the file name of which contains the string "filename". Easier and
faster than the previous command but depends on a database that
normally rebuilds at night.
Copy files
Basic Administration Commands
 adduser user_name
Create a new account (you must be root). E.g., adduser barbara Don't
forget to set up the password for the new user in the next step. The user
home directory is /home/user_name.
 useradd user_name
The same as the command " adduser user_name ".
 userdel user_name
Remove an account (you must be a root). The user's home directory and
the undelivered mail must be dealt with separately (manually because you
have to decide what to do with the files).
 groupadd group_name
Create a new group on your system. Non-essential but can be handy even
on a home machine with a small number of users.
 passwd user_name
Change the password on your current account. If you are root, you can
change the password for any user using: passwd user_name
Permissions
 File Permissions
 chmod perm filename 
 chmod  command sets the permission of a file or folder. chmod command 
uses three digit code as an argument and the file or folder location.
 In the example,
     7 – Owner(current user)
     5 – Group(set by owner)
     4 – anyone else
 The fundamental concept:
 Execute is 1, Write is 2 and Read is 4.
 Sum of these basic ones makes combination of permissions:
     0 – no permission, this person cannot read, write or execute
     1 – execute only
     2 – write only
     3 – execute and write only (1 + 2)
     4 – read only
     5 – execute and read only (1 + 4)
     6 – write and read only (2 + 4)
     7 – execute, write and read (1 + 2 + 4)
Permissions
Account Permissions
 examples:
 sudo useradd -m -s /bin/bash  user_Name
 explain:  -s  User's login shell (default /bin/bash)
               -m  Create the home directory
              -M  Do not create the home directory
 2- sudo passwd user_Name
 3- unlock 
    sudo passwd -u user_Name
 4- Add Full Name
    sudo usermod -c  "Full Name"  user_Name
 5- add group
   sudo groupadd  group_Name
 add user to group
  sudo  usermod  -G  group_Name  user_Name
 6- Delete a user
   userdel -r  user_Name
 id       Print user and group id's
Account Permissions
Pipe
 The pipe allows us to change this paradigm, whereby the output of one 
program becomes the input of another program.
 Example1 :
 I would do that by using the | character — which is called, appropriately 
enough, the pipe — as follows:
 $ ls -l | less
 This tells BASH to do the following:
     1-Execute the ls command, with the parameter -l as input
     2-Take the results of executing that command — the output — and pass 
them     as input to the less command
     3-Send the output of the less command to the monitor as usual
 Example2 :
 $ ls -l | grep 'init' | less
 List all of the files, using the -l option
 Search the results of that file listing for the string init
 Send the results of that search to less
Pipe
Redirection
 Redirection is similar to pipes except using files rather than another 
program. The standard output for a program is the screen. Using the > 
(greater than) symbol the output of a program can be sent to a file. Here 
is a directory listing of /dev again but this time redirected to a file called 
listing.txt
 ls -la > listing.txt
 There won’t be anything displayed on the terminal as everything was sent 
to the file. You can take a look at the file using the cat command (which 
can be piped into more) or for convenience you can just use the more 
command on its own:
 more listing.txt
 If listing.txt had already existed, it will be overwritten. But you can append 
      to an existing file using >> like this:
        ls -la /home > listing.txt
             ls -la /dev >> listing.txt
Search Command
 Grep command
 How do I use grep with other commands?
 The syntax is:
 command | grep 'search-pattern'
 command1 | command2 | grep 'search-pattern'
 In this example, run ls command and search for the string/pattern called 
resume.pdf:
 ls | grep resume.pdf
 ls -l | grep resumd.pdf
 ls -l *.mov | grep 'birthday'
 ls -l *.mov | grep  -i 'birthday'
Find Command
 The Linux Find Command is one of the most important and much used 
command in Linux systems. Find command used to search and locate list 
of files and directories based on conditions you specify for files that match 
the arguments. Find can be used in variety of conditions like you can find 
files by permissions, users, groups, file type, date, size and other possible 
criteria
 Example1
 Find all the files whose name is tecmint.txt in a current working directory.
 # find . -name tecmint.txt.
 Find all php files in a directory.
 Example 2:
 # find . -type f -name "*.php"
        ./tecmint.php
        ./login.php
        ./index.php
Network
  ping   Test a network connection
   ping  user_Name
 ets…..
 Nmap ("Network Mapper") is an open source tool for network exploration 
and security auditing.
 sudo apt-get install nmap
 To quickly identify all available Ethernet interfaces, you can use the 
ifconfig command as shown below.
 ifconfig -a | grep eth
 eth0      Link encap:Ethernet  HWaddr 00:15:c5:4a:16:5a
 ethtool is a program that displays and changes Ethernet card settings 
such as auto-negotiation, port speed, duplex mode, and Wake-on-LAN. It 
is not installed by default, but is available for installation in the 
repositories.
 sudo apt-get install ethtool
 The following is an example of how to view supported features and
configured settings of an Ethernet interface.
 sudo ethtool eth0
 To temporarily configure an IP address, you can use the ifconfig command
in the following manner. Just modify the IP address and subnet mask to
match your network requirements.
 sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0
 To verify the IP address configuration of eth0, you can use the ifconfig
command in the following manner.
 ifconfig eth0
 To verify your default gateway configuration, you can use the route
command in the following manner.
 route –n
 Display Information of All Network Interfaces
Network
 ifconfig eth0
 To verify your default gateway configuration, you can use the route
command in the following manner.
 route –n
 Display Information of All Network Interfaces
 ifconfig –a
 How to Disable an Network Interface
 ifconfig eth0 down
 OR
 ifdown eth0
 How to Assign a IP Address to Network Interface
 ifconfig eth0 172.16.25.125
Network
Tcpdump Commands – A Network Sniffer Tool
tcpdump is a most powerful and widely used command-line packets
sniffer or package analyzer tool which is used to capture or filter TCP/IP
packets that received or transferred over a network on a specific
interface.
How to Install tcpdump in Linux
Many of Linux distributions already shipped with tcpdump tool, if in case
you don’t have it on systems, you can install it using following Yum
command.
#yum install tcpdump
1.Capture Packets from Specific Interface
 tcpdump -i eth0
2.Capture Only N Number of Packets
tcpdump -c 5 -i eth0
3.Display Available Interfaces
tcpdump -D
4.Capture IP address Packets
tcpdump -n -i eth0
5.Capture only TCP Packets.
tcpdump -i eth0 tcp
6.Capture Packets from source IP
tcpdump -i eth0 src 192.168.0.2
7.Capture Packets from destination IP
tcpdump -i eth0 dst 50.116.66.139
Tcpdump Commands – A Network Sniffer Tool
install , remove App in linux
 1- install :
 sudo apt-get install Package_Name
 2- remove :
 apt-get remove package_Name
 To remove any unused packages, use the “autoremove” command, as
shown in the following command.
 sudo apt-get autoremove
 You can combine the two commands for removing a program and
removing dependencies that are no longer being used into one, as shown
below (again, two dashes before “auto-remove”).
 sudo apt-get purge --auto-remove gimp
 If you’re short on space, you can use the “clean” command to remove
downloaded archive files, as shown below.
 sudo apt-get clean
print
 echo Display message on screen •
File Compression
 gzip Compress files
 (GNU Zip)
 compress Compress files (Unix)
 bzip2 Compress files (BZip2)
 zip Compress files
 (Windows Zip)
Disks and Filesystems
 df Show free disk space
 mount Make a disk accessible
 fsck Check a disk for errors
 sync Flush disk caches
Backups and Remote Storage
 mt Control a tape drive
 dump Back up a disk
 restore Restore a dump
 tar Read/write tape archives
 cdrecord Burn a CD
 rsync Mirror a set of files
File Properties
 stat Display file attributes
 wc Count bytes/words/lines
 du Measure disk usage
 file Identify file types
 touch Change file timestamps
 chown Change file owner
 chgrp Change file group
 chmod Change file protections
 chattr Change advanced file
 attributes
 lsattr List advanced file
 attributes
File Viewing
 cat View files
 less Page through files
 head View file beginning
 tail View file ending
 nl Number lines
 od View binary data
 xxd View binary data
 gv View Postscript/PDF files
 xdvi View TeX DVI files
File Location
 find Locate files
 slocate Locate files via index
 which Locate commands
 whereis Locate standard files
File/Directory Basics
 ls List files
 cp Copy files
 mv Rename files
 rm Delete files
 ln Link files
 cd Change directory
 pwd Print current directory
 name
 mkdir Create directory
 rmdir Delete directory
Printing
 lpr Print files
 lpq View print queue
 lprm Remove print jobs
Spelling Operations
 look Look up spelling
 aspell Check spelling
 interactively
 spell Check spelling in batch
Processes
 ps List all processes
 w List users’ processes
 uptime View the system load
 top Monitor processes
 xload Monitor system load
 free Display free memory
 kill Terminate processes
 nice Set process priorities
 renice Change process priorities
Scheduling Jobs
 sleep Wait for some time
 watch Run programs at set
 intervals
 at Schedule a job
 crontab Schedule repeated jobs
Hosts
 uname Print system information
 hostname Print the system’s
 hostname
 ifconfig Set/display network
 information
 host Look up DNS
 whois Look up domain
 registrants
 ping Check if host is reachable
 traceroute View network path to
 a host
Audio and Video
 grip Play CDs and rip MP3s
 xmms Play audio files
 cdparanoia Rip audio
 audacity Edit audio
 xcdroast Burn CDs
https://www.linkedin.com/in/ameer-sameer-452693107
https://www.facebook.com/ameer.Mee
http://www.slideshare.net/AmeerSameer
https://www.researchgate.net/profile/Ameer_Sameer

More Related Content

What's hot (20)

Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Linux
LinuxLinux
Linux
 
6 stages of linux boot process
6 stages of linux boot process6 stages of linux boot process
6 stages of linux boot process
 
The ps Command
The ps CommandThe ps Command
The ps Command
 
Linux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating SystemLinux - Introductions to Linux Operating System
Linux - Introductions to Linux Operating System
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Some basic unix commands
Some basic unix commandsSome basic unix commands
Some basic unix commands
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
package mangement
package mangementpackage mangement
package mangement
 
Basic Linux Internals
Basic Linux InternalsBasic Linux Internals
Basic Linux Internals
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
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
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
Linux file system
Linux file systemLinux file system
Linux file system
 

Viewers also liked

Best practices in IBM Operational Decision Manager Standard 8.7.0 topologies
Best practices in IBM Operational Decision Manager Standard 8.7.0 topologiesBest practices in IBM Operational Decision Manager Standard 8.7.0 topologies
Best practices in IBM Operational Decision Manager Standard 8.7.0 topologiesPierre Feillet
 
IBM Decision Server Insights
IBM Decision Server InsightsIBM Decision Server Insights
IBM Decision Server InsightsAlain Neyroud
 
IBM Operational Decision Manager - Decision Governance Framework
IBM Operational Decision Manager - Decision Governance FrameworkIBM Operational Decision Manager - Decision Governance Framework
IBM Operational Decision Manager - Decision Governance FrameworkArun Mathews
 
IBM ODM Rules Compiler support in IBM Streams V4.2.
IBM ODM Rules Compiler support in IBM Streams V4.2.IBM ODM Rules Compiler support in IBM Streams V4.2.
IBM ODM Rules Compiler support in IBM Streams V4.2.lisanl
 
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0Pierre Feillet
 
How Nationwide Insurance use IBM Decision Manager and BPM
How Nationwide Insurance use IBM Decision Manager and BPM How Nationwide Insurance use IBM Decision Manager and BPM
How Nationwide Insurance use IBM Decision Manager and BPM sflynn073
 
What is Ubuntu - presentation
What is Ubuntu - presentationWhat is Ubuntu - presentation
What is Ubuntu - presentationAhmed Mamdouh
 
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
Integrating Docker EE into Société Générale's Existing Enterprise IT SystemsIntegrating Docker EE into Société Générale's Existing Enterprise IT Systems
Integrating Docker EE into Société Générale's Existing Enterprise IT SystemsDocker, Inc.
 

Viewers also liked (10)

Best practices in IBM Operational Decision Manager Standard 8.7.0 topologies
Best practices in IBM Operational Decision Manager Standard 8.7.0 topologiesBest practices in IBM Operational Decision Manager Standard 8.7.0 topologies
Best practices in IBM Operational Decision Manager Standard 8.7.0 topologies
 
Introduction to Ubantu
Introduction to UbantuIntroduction to Ubantu
Introduction to Ubantu
 
IBM Decision Server Insights
IBM Decision Server InsightsIBM Decision Server Insights
IBM Decision Server Insights
 
IBM Operational Decision Manager - Decision Governance Framework
IBM Operational Decision Manager - Decision Governance FrameworkIBM Operational Decision Manager - Decision Governance Framework
IBM Operational Decision Manager - Decision Governance Framework
 
IBM ODM Rules Compiler support in IBM Streams V4.2.
IBM ODM Rules Compiler support in IBM Streams V4.2.IBM ODM Rules Compiler support in IBM Streams V4.2.
IBM ODM Rules Compiler support in IBM Streams V4.2.
 
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
Best practices in deploying IBM Operation Decision Manager Standard 8.8.0
 
How Nationwide Insurance use IBM Decision Manager and BPM
How Nationwide Insurance use IBM Decision Manager and BPM How Nationwide Insurance use IBM Decision Manager and BPM
How Nationwide Insurance use IBM Decision Manager and BPM
 
What is Ubuntu - presentation
What is Ubuntu - presentationWhat is Ubuntu - presentation
What is Ubuntu - presentation
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
Integrating Docker EE into Société Générale's Existing Enterprise IT SystemsIntegrating Docker EE into Société Générale's Existing Enterprise IT Systems
Integrating Docker EE into Société Générale's Existing Enterprise IT Systems
 

Similar to Common Linux Ubuntu Commands Overview: 40 Essential Commands

The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manualSaikat Rakshit
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manualCraig Cannon
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Linux presentation
Linux presentationLinux presentation
Linux presentationNikhil Jain
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unixsouthees
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.pptLuigysToro
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigationhetaldobariya
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structureSreenatha Reddy K R
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administratorDinesh jaisankar
 
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
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to LinuxDimas Prasetyo
 

Similar to Common Linux Ubuntu Commands Overview: 40 Essential Commands (20)

Rhel1
Rhel1Rhel1
Rhel1
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 
Linux file system nevigation
Linux file system nevigationLinux file system nevigation
Linux file system nevigation
 
Linux commands and file structure
Linux commands and file structureLinux commands and file structure
Linux commands and file structure
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
 
Introduction to linux day1
Introduction to linux day1Introduction to linux day1
Introduction to linux day1
 
Linux
LinuxLinux
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
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux
LinuxLinux
Linux
 
basic-unix.pdf
basic-unix.pdfbasic-unix.pdf
basic-unix.pdf
 

More from Ameer Sameer

Web ontology language (owl)
Web ontology language (owl)Web ontology language (owl)
Web ontology language (owl)Ameer Sameer
 
Cognitive radio wireless sensor networks applications, challenges and researc...
Cognitive radio wireless sensor networks applications, challenges and researc...Cognitive radio wireless sensor networks applications, challenges and researc...
Cognitive radio wireless sensor networks applications, challenges and researc...Ameer Sameer
 
Security of software defined networking (sdn) and cognitive radio network (crn)
Security of software defined networking (sdn) and  cognitive radio network (crn)Security of software defined networking (sdn) and  cognitive radio network (crn)
Security of software defined networking (sdn) and cognitive radio network (crn)Ameer Sameer
 
Software defined networking players
Software defined networking playersSoftware defined networking players
Software defined networking playersAmeer Sameer
 
Open network operating system (onos)
Open network operating system (onos)Open network operating system (onos)
Open network operating system (onos)Ameer Sameer
 
Internet of things (IoT)
Internet of things (IoT)Internet of things (IoT)
Internet of things (IoT)Ameer Sameer
 
Cognitive radio networks
Cognitive radio networksCognitive radio networks
Cognitive radio networksAmeer Sameer
 

More from Ameer Sameer (7)

Web ontology language (owl)
Web ontology language (owl)Web ontology language (owl)
Web ontology language (owl)
 
Cognitive radio wireless sensor networks applications, challenges and researc...
Cognitive radio wireless sensor networks applications, challenges and researc...Cognitive radio wireless sensor networks applications, challenges and researc...
Cognitive radio wireless sensor networks applications, challenges and researc...
 
Security of software defined networking (sdn) and cognitive radio network (crn)
Security of software defined networking (sdn) and  cognitive radio network (crn)Security of software defined networking (sdn) and  cognitive radio network (crn)
Security of software defined networking (sdn) and cognitive radio network (crn)
 
Software defined networking players
Software defined networking playersSoftware defined networking players
Software defined networking players
 
Open network operating system (onos)
Open network operating system (onos)Open network operating system (onos)
Open network operating system (onos)
 
Internet of things (IoT)
Internet of things (IoT)Internet of things (IoT)
Internet of things (IoT)
 
Cognitive radio networks
Cognitive radio networksCognitive radio networks
Cognitive radio networks
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Common Linux Ubuntu Commands Overview: 40 Essential Commands

  • 1. Common Linux Ubuntu Commands Overview Prepared by: Ameer Sameer Hamood University of Babylon - Iraq Information Technology - Information Networks
  • 2.
  • 3. System Information  pwd Print working directory, i.e., display the name of my current directory on the screen.  hostname Print the name of the local host (the machine on which you are working). Use netconf (as root) to change the name of the machine.  id username Print user id (uid) and his/her group id (gid), effective id (if different than the real id) and the supplementary groups.  date Print or change the operating system date and time. E.g., I could change the date and time to 2000-12-31 23:57 using this command: date 123123572000 To set the hardware (BIOS) clock from the system (Linux) clock, use the command (as root) setclock
  • 4.  who Determine the users logged on the machine.  finger user_name System info about a user. Try: finger root . displays the user's login name, real name, terminal name and write status (as a ``*'' after the terminal name if write permission is denied), idle time, login time, office location .  history | more Show the last (1000 or so) commands executed from the command line on the current account. The "| more" causes the display to stop after each screenful. System Information
  • 5. Basic operations  any_command --help |more Display a brief help on a command (works with most commands). "--help" works similar to DOS "/h" switch. The "more" pipe is needed if the output is longer than one screen.  man topic Display the contents of the system manual pages (help) on the topic.  Info topic  information pages, which are generally more in-depth than man pages.
  • 6. List Command  ls - Short listing of directory contents  -a list hidden files  -d list the name of the current directory  -F show directories with a trailing '/'  executable files with a trailing '*'  -g show group ownership of file in long listing  -i print the inode number of each file  -l long listing giving details about files and directories  -R list all subdirectories encountered  -t sort by time modified instead of name
  • 7. Copy files  cp file1 file2  or  cp myfile yourfile  Copy the files "myfile" to the file "yourfile" in the current working directory. This command will create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.  cp -i myfile yourfile  With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.  mv source destination Move or rename files. The same command is used for moving and renaming files and directories. Ex: mv testdir newnamedir
  • 8.  rm files Remove (delete) files. You must own the file in order to be able to remove it. On many systems, you will be asked or confirmation of deleation, if you don't want this, use the "-f" (=force) option, e.g., rm -f * will remove all files in my current working directory, no questions asked.  mkdir directory Make a new directory.  rmdir directory Remove an empty directory.  rm -r files (recursive remove) Remove files, directories, and their subdirectories. Careful with this command as root--you can easily remove all files on the system with such a command executed on the top of your directory tree, and there is no undelete in Linux (yet). But if you really wanted to do it (reconsider), here is how (as root): rm -rf /* Copy files
  • 9.  cat filename  View the content of a text file called "filename"  find / -name filename Find the file called "filename" on your file system starting the search from the root directory "/". The "filename" may contain wildcards (*,?).ex: find / -name "file.text"  locate filename Find the file name of which contains the string "filename". Easier and faster than the previous command but depends on a database that normally rebuilds at night. Copy files
  • 10. Basic Administration Commands  adduser user_name Create a new account (you must be root). E.g., adduser barbara Don't forget to set up the password for the new user in the next step. The user home directory is /home/user_name.  useradd user_name The same as the command " adduser user_name ".  userdel user_name Remove an account (you must be a root). The user's home directory and the undelivered mail must be dealt with separately (manually because you have to decide what to do with the files).  groupadd group_name Create a new group on your system. Non-essential but can be handy even on a home machine with a small number of users.  passwd user_name Change the password on your current account. If you are root, you can change the password for any user using: passwd user_name
  • 11. Permissions  File Permissions  chmod perm filename   chmod  command sets the permission of a file or folder. chmod command  uses three digit code as an argument and the file or folder location.  In the example,      7 – Owner(current user)      5 – Group(set by owner)      4 – anyone else  The fundamental concept:  Execute is 1, Write is 2 and Read is 4.
  • 12.  Sum of these basic ones makes combination of permissions:      0 – no permission, this person cannot read, write or execute      1 – execute only      2 – write only      3 – execute and write only (1 + 2)      4 – read only      5 – execute and read only (1 + 4)      6 – write and read only (2 + 4)      7 – execute, write and read (1 + 2 + 4) Permissions
  • 13. Account Permissions  examples:  sudo useradd -m -s /bin/bash  user_Name  explain:  -s  User's login shell (default /bin/bash)                -m  Create the home directory               -M  Do not create the home directory  2- sudo passwd user_Name  3- unlock      sudo passwd -u user_Name  4- Add Full Name     sudo usermod -c  "Full Name"  user_Name
  • 14.  5- add group    sudo groupadd  group_Name  add user to group   sudo  usermod  -G  group_Name  user_Name  6- Delete a user    userdel -r  user_Name  id       Print user and group id's Account Permissions
  • 15. Pipe  The pipe allows us to change this paradigm, whereby the output of one  program becomes the input of another program.  Example1 :  I would do that by using the | character — which is called, appropriately  enough, the pipe — as follows:  $ ls -l | less  This tells BASH to do the following:      1-Execute the ls command, with the parameter -l as input      2-Take the results of executing that command — the output — and pass  them     as input to the less command      3-Send the output of the less command to the monitor as usual
  • 16.  Example2 :  $ ls -l | grep 'init' | less  List all of the files, using the -l option  Search the results of that file listing for the string init  Send the results of that search to less Pipe
  • 17. Redirection  Redirection is similar to pipes except using files rather than another  program. The standard output for a program is the screen. Using the >  (greater than) symbol the output of a program can be sent to a file. Here  is a directory listing of /dev again but this time redirected to a file called  listing.txt  ls -la > listing.txt  There won’t be anything displayed on the terminal as everything was sent  to the file. You can take a look at the file using the cat command (which  can be piped into more) or for convenience you can just use the more  command on its own:  more listing.txt  If listing.txt had already existed, it will be overwritten. But you can append        to an existing file using >> like this:         ls -la /home > listing.txt              ls -la /dev >> listing.txt
  • 18. Search Command  Grep command  How do I use grep with other commands?  The syntax is:  command | grep 'search-pattern'  command1 | command2 | grep 'search-pattern'  In this example, run ls command and search for the string/pattern called  resume.pdf:  ls | grep resume.pdf  ls -l | grep resumd.pdf  ls -l *.mov | grep 'birthday'  ls -l *.mov | grep  -i 'birthday'
  • 19. Find Command  The Linux Find Command is one of the most important and much used  command in Linux systems. Find command used to search and locate list  of files and directories based on conditions you specify for files that match  the arguments. Find can be used in variety of conditions like you can find  files by permissions, users, groups, file type, date, size and other possible  criteria  Example1  Find all the files whose name is tecmint.txt in a current working directory.  # find . -name tecmint.txt.  Find all php files in a directory.  Example 2:  # find . -type f -name "*.php"         ./tecmint.php         ./login.php         ./index.php
  • 20. Network   ping   Test a network connection    ping  user_Name  ets…..  Nmap ("Network Mapper") is an open source tool for network exploration  and security auditing.  sudo apt-get install nmap  To quickly identify all available Ethernet interfaces, you can use the  ifconfig command as shown below.  ifconfig -a | grep eth  eth0      Link encap:Ethernet  HWaddr 00:15:c5:4a:16:5a  ethtool is a program that displays and changes Ethernet card settings  such as auto-negotiation, port speed, duplex mode, and Wake-on-LAN. It  is not installed by default, but is available for installation in the  repositories.
  • 21.  sudo apt-get install ethtool  The following is an example of how to view supported features and configured settings of an Ethernet interface.  sudo ethtool eth0  To temporarily configure an IP address, you can use the ifconfig command in the following manner. Just modify the IP address and subnet mask to match your network requirements.  sudo ifconfig eth0 10.0.0.100 netmask 255.255.255.0  To verify the IP address configuration of eth0, you can use the ifconfig command in the following manner.  ifconfig eth0  To verify your default gateway configuration, you can use the route command in the following manner.  route –n  Display Information of All Network Interfaces Network
  • 22.  ifconfig eth0  To verify your default gateway configuration, you can use the route command in the following manner.  route –n  Display Information of All Network Interfaces  ifconfig –a  How to Disable an Network Interface  ifconfig eth0 down  OR  ifdown eth0  How to Assign a IP Address to Network Interface  ifconfig eth0 172.16.25.125 Network
  • 23. Tcpdump Commands – A Network Sniffer Tool tcpdump is a most powerful and widely used command-line packets sniffer or package analyzer tool which is used to capture or filter TCP/IP packets that received or transferred over a network on a specific interface. How to Install tcpdump in Linux Many of Linux distributions already shipped with tcpdump tool, if in case you don’t have it on systems, you can install it using following Yum command. #yum install tcpdump 1.Capture Packets from Specific Interface  tcpdump -i eth0
  • 24. 2.Capture Only N Number of Packets tcpdump -c 5 -i eth0 3.Display Available Interfaces tcpdump -D 4.Capture IP address Packets tcpdump -n -i eth0 5.Capture only TCP Packets. tcpdump -i eth0 tcp 6.Capture Packets from source IP tcpdump -i eth0 src 192.168.0.2 7.Capture Packets from destination IP tcpdump -i eth0 dst 50.116.66.139 Tcpdump Commands – A Network Sniffer Tool
  • 25. install , remove App in linux  1- install :  sudo apt-get install Package_Name  2- remove :  apt-get remove package_Name  To remove any unused packages, use the “autoremove” command, as shown in the following command.  sudo apt-get autoremove  You can combine the two commands for removing a program and removing dependencies that are no longer being used into one, as shown below (again, two dashes before “auto-remove”).  sudo apt-get purge --auto-remove gimp  If you’re short on space, you can use the “clean” command to remove downloaded archive files, as shown below.  sudo apt-get clean
  • 26. print  echo Display message on screen •
  • 27. File Compression  gzip Compress files  (GNU Zip)  compress Compress files (Unix)  bzip2 Compress files (BZip2)  zip Compress files  (Windows Zip)
  • 28. Disks and Filesystems  df Show free disk space  mount Make a disk accessible  fsck Check a disk for errors  sync Flush disk caches
  • 29. Backups and Remote Storage  mt Control a tape drive  dump Back up a disk  restore Restore a dump  tar Read/write tape archives  cdrecord Burn a CD  rsync Mirror a set of files
  • 30. File Properties  stat Display file attributes  wc Count bytes/words/lines  du Measure disk usage  file Identify file types  touch Change file timestamps  chown Change file owner  chgrp Change file group  chmod Change file protections  chattr Change advanced file  attributes  lsattr List advanced file  attributes
  • 31. File Viewing  cat View files  less Page through files  head View file beginning  tail View file ending  nl Number lines  od View binary data  xxd View binary data  gv View Postscript/PDF files  xdvi View TeX DVI files
  • 32. File Location  find Locate files  slocate Locate files via index  which Locate commands  whereis Locate standard files
  • 33. File/Directory Basics  ls List files  cp Copy files  mv Rename files  rm Delete files  ln Link files  cd Change directory  pwd Print current directory  name  mkdir Create directory  rmdir Delete directory
  • 34. Printing  lpr Print files  lpq View print queue  lprm Remove print jobs
  • 35. Spelling Operations  look Look up spelling  aspell Check spelling  interactively  spell Check spelling in batch
  • 36. Processes  ps List all processes  w List users’ processes  uptime View the system load  top Monitor processes  xload Monitor system load  free Display free memory  kill Terminate processes  nice Set process priorities  renice Change process priorities
  • 37. Scheduling Jobs  sleep Wait for some time  watch Run programs at set  intervals  at Schedule a job  crontab Schedule repeated jobs
  • 38. Hosts  uname Print system information  hostname Print the system’s  hostname  ifconfig Set/display network  information  host Look up DNS  whois Look up domain  registrants  ping Check if host is reachable  traceroute View network path to  a host
  • 39. Audio and Video  grip Play CDs and rip MP3s  xmms Play audio files  cdparanoia Rip audio  audacity Edit audio  xcdroast Burn CDs