You are on page 1of 3

Assignment 1

Study of Linux Commands

1. ls command
This command is used to list the contents of a specified directory.
a. ls -a
It shows all the hidden files in the directory
b. ls p
c. ls r
It lists all the files in reverse order
d. ls t
It sorts the files by their modification time, showing the last edited file
first.
e. ls s
It lists file size with the file names

2. touch command
It is used to create an empty file. This command is also used to change the
last modification and access time of a specified file into specified time.
Example: touch file <filename> touch MMDDHHmm <filename>
file f1.txt touch 062209

3. ps command
This command is used to know which processes are running at our terminal
a. ps -this will list all the processes of all the users who are logged into
the system
b. ps -x list all system process
c. ps -u list all processes of specified user
d. ps -t list all processes of specified terminal

Background processing commands


4. kill command
It will kill a process with particular PID (eg. kill 2824)

5. at command
It is used to execute the specified linux command at a specified future time (at
12:00 excho "unch")

General purpose command


6. date command
Displays the system date and time

7. who command
It will display the list of users logged in to system currently

8. who am i command
It tells you, who you are, working on current terminal

9. man command
It gives the manual book of succeeding command

10. cal
It displays calendar of the specified month and year

11. expr command


It will perform arithmetic operation

12. bc command
It helps you work on a basic calculator
a. ibase command
It defines the base of input base value for a specific number
Example: $ echo 'ibase=16; FEF33D9' | bc
267334617
b. obase command
It defines the base of output base value for a specific number
Example: echo "obase=2; 23" | bc
10111

13. pipe Command


It is used to run two commands together

14. sort command


It is used to sort the given items

15. grep Command


The grep filter searches a file for a particular pattern of characters, and
displays all lines that contain that pattern. The pattern that is searched in the
file is referred to as the regular expression (grep stands for globally search for
regular expression and print out).
a. grep c
This command only prints the count of lines that match the pattern
b. grep i
This command ignores the case while matching the pattern
c. grep n
Display the matched lines and their line numbers.
d. grep v
This prints out all the lines that do not matches the pattern
e. e grep
It scans a specified file line by line, returning lines that contain a pattern
matching a given regular expression
f. f grep
It searches for fixed-character strings in a file or files

16. uniq command


It is used to handle duplicate line in the file by filtering them out.

17. tr command
It is used for translating characters. It supports a range of transformations
including uppercase to lowercase, squeezing repeating characters, deleting
specific characters and basic find and replace.

xxx---xxx

You might also like