You are on page 1of 2

CSE 3202

Operating Systems Lab (Group Work)


Roll No: 133094, 133096, 133099, 133103, 133106

Some Useful Linux Commands


Command Description
whoami Prints the user name associated with the
current effective user ID.
who Shows the users who are logged on.
pwd Prints the full filename of the current
working directory.
date Displays the current time in the given
FORMAT, or set the system date.
cal Display the current month
cal year (Ex: cal 2017) Display the calendar of a specific year
cal -y Display the calendar of current year
sudo sudo allows a permitted user to execute a
command as the superuser or another user.
su Changes user ID or become superuser
cat Concatenates FILE(s), or standard input, to
(Ex: cat sample.txt - display content of a file. standard output. With no FILE, or when FILE
cat *.txt - display content of all txt files. is -, it reads standard input.
cat sample.txt sample1.txt > sample2.txt -
concatenate two files and save it in another file.
)
uptime uptime gives a one line display of the
following information. The current time, how
long the system has been running, how many
users are currently logged on, and the system
load averages for the past 1, 5, and 15
minutes.
free free displays the total amount of free and
free -b (displays the amount of memory in bytes) used physical and swap memory in the
free -m (displays the amount of memory in system, as well as the buffers used by the
megabytes) kernel.
top The top program provides a dynamic real-
(press q to quit) time view of a running system. It can display
system summary information as well as a list
of tasks currently being managed by the
Linux kernel.
history Lists the commands that the user has run so
far
Clear Clears the terminal screen
man It is the interface used to view the system's
(Ex: man ls) reference manuals.
*More commands can be found at: http://www.tutorialspoint.com/unix_commands/index.htm
SHORTCUTS:
Tab autocomplete
!! refers to the last used command (Ex- sudo !! means to execute the previous command as the
superuser.)
SHIFT+PageUp/PageDown Scroll up or down in the terminal/command line mode

You might also like