And now a bit of the day-to-day Linux commands I use in Ubuntu
This the most common command that all *nix users use to show the file(s) in list format.
rm -rf <filename(s)>
To delete a file, use this command. Be careful, no retrieval will help you to get your file.
I use to do this just to restart my networking everytime I make some changes on /etc/network/interfaces or just to restart ethernet to get a new IP from DHCP server.
To make sure that you’re connected to the internet, use this command to test your connection to <hostname>. Example:
~# ping 220.127.116.11
PING 18.104.22.168 (22.214.171.124) 56(84) bytes of data.
64 bytes from 126.96.36.199: icmp_req=1 ttl=251 time=14.4 ms
64 bytes from 188.8.131.52: icmp_req=2 ttl=251 time=14.9 ms
64 bytes from 184.108.40.206: icmp_req=3 ttl=251 time=15.4 ms
64 bytes from 220.127.116.11: icmp_req=4 ttl=251 time=17.7 ms
— 18.104.22.168 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 14.487/15.655/17.796/1.280 ms
To show the content of <filename>
Debian uses this command to configure some packages configuration.
apt-get install <package_name>
apt-get update && apt-get upgrade
To make sure you have the latest package list, use the command apt-get update and to upgrade your package to the latest version use command apt-get upgrade or you can just use both command in one single line.
apt-get remove <package>
To uninstall package, use the above command.
dpkg -P <package>
Sometime some configuration file(s) are not completely removed. Use this command to clean all the file(s) related to the package
dpkg -l | grep <>
To see what kind of package(s) is or are installed use the command
dpkg -l or if you need to know whether you have installed package X or not you can simply use dpkg -l | grep X
grep <word> <filename>
If you need to know whether in <filename> contains this <word> you can use this command.
To empty or erase the content of <filename>
This is for finding <filename> using file list database.
If you can’t see how big the size of your directory is using ls -l, use this command.
This is to list the mounted partition available on your computer.
To check how ‘far’ your computer from <hostname|fqdn>