Insights into Basic Ubuntu commands.
The ubuntu terminal has millions of commands. Meaning you have to write a command to tell the computer what you need it to do which seems daunting and time wasting to a lot of people. But there are great advantages to using these commands!!! Such as boasting rights and showing off to your friends, as one of my teaching fellows will say. lol
NB: I will first define them as it is in the terminal manual before further explanations.
Some of these commands are:
CUT — Is a command used to remove sections from each line of files as explained in the manual. Meaning it is used to extract portions of text from files by selecting its columns. In other words, it concatenate the file, then write them to standard output.
It can be used in the following ways,
- cut -b — which select only the bytes
2. cut -c — which select only the characteristics
3. cut -f — which select only the fields.
UPTIME — is a command to find how long a system has been running. To use, you just type uptime in your terminal and then enter.
The command will give a one-line display as below
1) The current time (20:03:50)
2) How long the system has been running (up 2 days)
3)How many users are currently logged on (2 users)
4) The system load averages for the past 1, 5 and 15 minutes (0.47, 0.52, 0.45)
TAR — Which stands for tape archive is the GNU version of the tar archiving utility, that stores and extract files from a tape or disk archive.
It was used by system admins previously to deal with tape drive backups.
Now, it is usually used to create compressed archive files that can be moved from one disk to another easily.
From computer to computer, one user can use the tar command to large files, whiles another user can use to extract those files.
The tar command can be used in a lot of ways, example is:
i.To create an archive of a subdirectory as shown below;
From the diagram, i created a subdirectory named ‘seth’ and then created an uncompressed archive of the subdirectory ‘seth’ which is (tar cvf seth,19920912,tar seth).
The cvf in this command means:
- c -create archive
2. v- verbose, that tells the tar command to print all the filenames as they are added to the archive
3. f- tells tar that the name of the archive appears next
ii. To list the contents of an uncompressed tar archive,
iii. To extract the contents of an uncompressed tar archive,
iii. To extract the contents of a compressed tar archive,
tar xzvf seth.19920912.tar.gz
TOP — Displays the processes using the most system resources at any given time, after which the letter “q” can be used to exit.
Basically, it monitors performance! As in, it displays all the active real time and running processes in order, and updates it regularly.
some of its displays are, PID, USER, PR, TIME etc.
NB: The processes with the most CPU are on top.
NETSTAT — Means network Statistics and it monitors network connections, both incoming and outgoing, plus routing tables, interface statistics, masquerade connections and multicast memberships, as stated in the manual.
It is able to tell what ports are open and if any other program is listening on ports that are waiting for incoming connection. So basically netstat is essential because, it determines network traffic performance and troubleshoot network related problems.
- To list out only UDP connections,
2. To list out only TCP connections,
3. To view only listening ports,
FG — Is the command that runs jobs in the foreground. That is, if you enable job control, it moves a job running at the background to the foreground.
Job control also means the ability to suspend the execution of commands and resume their operation any time the user wants.
ie. The most recently suspended or backgrounded job is resumed.
SSH — which stands for secure shell, is a program for logging into and executing commands on a remote machine.
It allows you to connect with another system and to communicate with it securely. Data exchanged is encrypted, so there’s no worry of password theft and data
ZIP — is a compressing and file packaging utility for most operating systems.
This command is used for packaging a set of files for distribution, for archiving files and for saving disk space by compressing unused files temporarily.
SCP — which is the secure copy or transfer of files between hosts on a network. It uses an ssh connection in the background to perform file transfer. By default, scp uses port 22 and connect through an encrypted connection.
If the need be,scp asks for passwords or passphrase for authentication.
So there you have it,a few ubuntu commands!!!
Hope this is enough to whet your appetite for command line interfaces.