0% found this document useful (0 votes)
16 views10 pages

Practical 1 Aim: Study of Basic Commands 1.Cd: The CD Command Is Used To Change The Current Directory

The document outlines basic Unix commands and their functionalities, including navigation commands like 'cd' and 'ls', as well as file manipulation commands such as 'cp', 'mv', and 'rm'. It also covers commands for displaying system information, managing directories, and viewing command history. Each command is accompanied by various options to enhance their usage.

Uploaded by

fenyntejani7
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)
16 views10 pages

Practical 1 Aim: Study of Basic Commands 1.Cd: The CD Command Is Used To Change The Current Directory

The document outlines basic Unix commands and their functionalities, including navigation commands like 'cd' and 'ls', as well as file manipulation commands such as 'cp', 'mv', and 'rm'. It also covers commands for displaying system information, managing directories, and viewing command history. Each command is accompanied by various options to enhance their usage.

Uploaded by

fenyntejani7
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
You are on page 1/ 10

Practical 1

Aim : study of basic commands


1.Cd : The cd command is used to change the current directory
cd .. : Change Current directory to parent directory
cd ~ : Move to users home directory from anywhere
cd comp22 : Change from current working directory to comp22.

2. ls : List directory contents.


ls -l : To show long listing information about the file/directory
ls -a : List all files including hidden file starting with ‘ . ‘
ls -c : sort by ctime , newest first.
ls -C : List entries by columns.

3. man : It is the interface used to view the system’s reference manuals.


4. echo : Display a line of text/string on standard output or a file.
echo -n :Do not output a trailing newline
echo -e Enable interpretation of backslash escape sequences
\b : It removes all the spaces in between the text
\n : It creates new line from where it is used
\c : Produce no further output

5. cal : Displays a simple, formatted calendar in your terminal.


cal -1 : Display single month output.
cal -3 Display three months spanning the date.
cal -y : Displays a calendar for the whole year.
cal -h : It will not highlight the date
cal -N : It will show the calendar in cal.
6. date : Print or set the system date and time.
date +%B : Locate’s full month name (e.g., January)
date +%V : ISO week number, with Monday as first day of week (01..53)
date +%P : locate’s equivalent of either AM or PM
date +%C : The current century; like %Y, except omit last two digit (e.g., 20)

7. clear
8. cat : It is used to create, display and concatenate file contents.
cat -b : Omits line numbers for blank space in the output
cat -E : Displays a $ (dollar sign) at the end of each line
cat -n : Line numbers for all the output lines
cat -s : Suppress repeated empty output lines
cat -T : Displays the tab characters as ^I in the output
9. pwd (Print working directory) : It prints the current working directory name with the
complete path starting from root (/).

10. who : It display the users that are currently logged into your Unix
computer system.
who -b : Display the time of the last system boot
who -H : Print a line of column headings
who -q : Displays all login names, and a count of all logged-on users
who -a : Display all details of current logged in user

11. whoami : This command prints the username associated with the current
effective user ID.
whoami –help : Display a help message, and exit
whoami --version : Display version information, and exit
12. uname (unix name) : Print information about the current system.
uname -s Print the kernel name
uname -n Print the network node hostname
uname -v Print the kernel version
uname -m Print the machine hardware name
uname -o Print the operating system

13. passwd : The passwd command is used to change the password of


a user account.
14. mkdir : This command is used to make Directories.
mkdir -v : Print a message for each created directory
mkdir -p : No error if existing, make parent directories as needed
mkdir -m : To control the permissions of new directories

15. rmdir : This command removes empty directories from your filesystem.
rmdir -p : Remove directory and its ancestors… e.g.,‘rmdir -p a/b/c’ is
similar to ‘rmdir a/b/c a/b a’

16. cp : This command is used to copy files and directories.


cp -i : Interactive - ask before overwrite
cp -f : Force copy by removing the destination file if needed
cp -s : Make symbolic links instead of copying
cp -v : Print informative messages
17. mv (move) : mv command is used to move files and directories.
mv -i : Interactive prompt before overwrite
mv -f Force move by overwriting destination file without prompt
mv -n Never overwrite any existing file
mv -u Update - move when source is newer than destination
mv -v Print informative messages

18.rm(remove) : The ‘rm’ command is used to delete files and directories.


rm -i : Prompt before every removal
rm -d : Delete a empty directory
rm -r : Remove directories and their contents recursively
rm -f : to remove the file forcefully
19. cut : The cut command extracts a given number of characters or
columns from a file.
cut -c: Select only the characters from each line as specified in LIST
cut -b : Select only the bytes from each line as specified in LIST
cut -f : Cuts the input file using list of field. The default field to be used
TAB. The default behavior can be overwritten by use of -d
Option

20. paste : The paste command displays the corresponding lines of multiple
files side-by-side.
paste -d : Reuse characters from LIST instead of tabs
paste -s: Paste one file at a time instead of in parallel
21. history : history command is used to view the previously executed
command.

You might also like