0% found this document useful (0 votes)
7 views3 pages

Essential Ubuntu Terminal Commands Guide

Operating System ubuntu lab commands implementing in linux

Uploaded by

saamiikhaan1800
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Essential Ubuntu Terminal Commands Guide

Operating System ubuntu lab commands implementing in linux

Uploaded by

saamiikhaan1800
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Ubuntu command

S# Command Format Description


1 Ctrl+alt+t or To access terminal window or command line
window btn +t in ubuntu or
Or by right-clicking the mouse and selecting the
Open New Terminal option.
Command $command -optioins Example : will display date
arguments U can replace ch by different to get diff result
: $ date or i.e.
$ $date +%ch a = Abbreviated weekday. A = Full weekday.
b = Abbreviated month.
B = Full month.
c = Current day and time.
C = Display the century as a decimal number.
d = Day of the month.
D = Day in „mm/dd/yy‟ format
h = Abbrevated month day.
calendar cal 2024 cal < year> Display the calendar of the year
cal < month > <year> Display the specific month of that year
man date $man <command name> It help us to know about the particular
command and its options & working. It is
like„help‟ command in windows .
free free To check or see the amount of free memory
df df to see the current amount of free space on
your disk drives
clear It is used to clear the screen.
exit exit end a terminal session
pwd /home/mushi Pwd(print working directory)
Display current working directory
List ls List command i.e ls Display file or directory list of current directory
commands ls /usr Display directory list of current user
ls ~ /usr Or even specify multiple directories. In this
example we will list both the user's home
directory (symbolized by the “~” character)
and the /usr directory
ls -a -a or –all -a List all files, even those with names
ls -d -d or --directory -d Ordinarily, if a directory is specified, ls will
list the contents of the directory, not the
directory itself. Use this option in conjunction
with the -l option to see details about the
directory rather than its contents.
-h or - - human- readable In long format
ls -h -h or – human- listings, display file sizes in human readable
-h or –reeverse format rather than in bytes
ls -r -r or - - reeverse Display the results in
reverse order. Normally,ls displays its results
-S in ascending alphabetical order.
-S Sort results by file size.
-t -t Sort by modification time
-I -l Display results in long format.
cd cd , cd.. , cd/ , ls , ls -I , ls Change directory
/etc, ls /bin/sbin, ls ~ , ls -a ,
ls -lh/boot
mkdir dir1 dir2 dir3 Multiple directories can also be created using
single mkdir command
cp file1 file2 To copy fil1 to file2 or directory
Move mv file1 file2 mv i file1 file2 To rename file or directory or move
file/rename mv dir1 dir2 mv -u file1 file2 file/dircoty from one to another
file mv file1 file2 dir1 Move command with options like
directories -i : Before overwriting an existing file, prompt
the user for confirmation
-u: when moving files from one directory to
another, only copy files that either don't
exist, or are newer
Copy file cp file1 file2 cp -a file1 file2m Copy file or directory
/directories -i Options used with copy cp command
-r Cp
-u -a (copy the fles , directories and all of their
attributes
-i: Before overwriting an existing file, prompt
the user for confirmation
-r: Recursively copy directories and their
contents
-u: When copying files from one directory to
another, only copy files that either don't exist,
or are newer
Creating Touch [Link] We can create a file with name [Link] using
and empty touch command
txt file cat >[Link] We can also create a file with name [Link]
using cat > command

cat >>[Link] cat >> command : cat command is also used


to append a text in file.

cat [Link] cat command can also be used to read the


contents of a file

less [Link] Another option to view the contents of a text


file is the use of less command

Activity 1:

In this activity, you are required to perform tasks given below:

✓ Display the current date like


o Mar 15 17:41:45 2025
o only the full name of the day
o date in format like 03/17/25
✓ Display the calendar for the current month
✓ Display the calendar for the year 2012
✓ Display the calendar of 1947
✓ Display the calendar of Feb 2015

Activity 2:

In this activity, you are required to perform tasks given below:

✓ Display the amount of free storage on your machine


✓ Display the amount of free memory on your machine
✓ Display the user name of the current user
✓ Open the man of date free command

You might also like