Ubuntu Linux Basic Commands PDF
Ubuntu Linux Basic Commands PDF
1.ifconfig :
ifconfig (interface configurator) command is use to initialize an interface, assign IP Address to interface
and enable or disable interface on demand. With this command you can view IP
Address and Hardware / MAC address assign to interface and also MTU (Maximum transmission unit)
size.
Ex:ifconfig
2.ifconfig eth0:
ifconfig with interface (eth0) command only shows specific interface details like IP Address, MAC
Address etc. with -a options will display all available interface details if it is disable also.
Ex:ifconfig eth0
Ex: netstart –r
9.DIG Command
NS related information like A Record, CNAME, MX Record etc.
Dig (domain information groper) query D
This command mainly use to troubleshoot DNS related query.
EX:nslookup www.google.com
11. ROUTE Command
route command also shows and manipulate ip routing table. To see default routing table in Linux, type
the following command.
Ex: route
EX:system-config-network
13. HOSTNAME Command
hostname is to identify in a network. Execute hostname command to see the hostname
of your box. You can set hostname permanently in /etc/sysconfig/network. Need to
reboot box once set a proper hostname.
EX: hostname
13. sudo
This SuperUserDo is the most important command Linux newbies will use. Every single
command that needs root’s permission, need this sudo command. You can use sudo before
each command that requires root permissions –
Ex: sudo su
14. APT commands
Ex:Sudo apt-get update
● Install a package locally: sudo apt-get install . /package.deb.
● Install a package from the repository: sudo apt-get install
package.
● Uninstall a package from the repository: sudo apt-get purge
package.
● Remove packages that are no longer needed: sudo apt-get autoremove
To update/upgrade the packages from this command is useful
15. lscpu: list CPU and processor info
Ex: iscpu
sudo apt-get
sudo Used before a command to run as root, or administrator.
update
ls Same as "dir"; lists the current directory. ls-ll
cp /dir/filename
cp Copy file.
/dir/filename
rm /dir/filename
rm Delete file.
/dir/filename
mv /dir/filename
mv Move file.
/dir/filename
mkdir Make a directory. mkdir /dirname
df Report file system disk space usage. df -h
dmesg Print or control the kernel ring buffer. dmesg
lspci Lists all PCI devices. lspci
lsusb Lists all USB devices. lsusb
lsmod Shows the status of modules in the Linux kernel. lsmod
cat Concatenate files and print on the standard output. cat /dir/logfile
grep Print lines of input matching a specified pattern. grep intel
apt-get update, or
apt-get Update installer.
apt-get upgrade
A utility that collects configuration and diagnostic information about your system.
The utility needs to be installed first using the following command line: "sudo
sosreport sosreport
apt-get install sosreport". It is recommended you reboot your system after the
install before first running the utility.