0% found this document useful (0 votes)
211 views

Important Linux Command

This document lists 31 common Linux commands and their uses such as wc to count lines, words and characters in a file, rm to remove files, ls to list directory contents, cp to copy files, sort to sort lines alphabetically, and ifconfig to display network configuration. It also provides examples for using commands like touch to create files, mkdir to make directories, chmod to change permissions, and cd to change the working directory. Overall, the document serves as a reference for many fundamental Linux commands.

Uploaded by

Abdur Rahman
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)
211 views

Important Linux Command

This document lists 31 common Linux commands and their uses such as wc to count lines, words and characters in a file, rm to remove files, ls to list directory contents, cp to copy files, sort to sort lines alphabetically, and ifconfig to display network configuration. It also provides examples for using commands like touch to create files, mkdir to make directories, chmod to change permissions, and cd to change the working directory. Overall, the document serves as a reference for many fundamental Linux commands.

Uploaded by

Abdur Rahman
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/ 3

Some Important Linux Command with question

1. What command is used to count the total number of lines, words, and
characters contained in a file?
Ans. wc or ls -l
2. What command is used to remove files?
Ans. rm filename
Example rm file1
3. What command is used to remove the directory?
Ans. rm –r
Example rm –r linux93
4. How could you install the file ipchains-1.3.9-5.i386.rpm?
Ans. rpm -i ipchains* .i386.rpm
5. What command do you use to create Linux file systems?
Ans. .mkfs
6. Which of the following command can you execute to count the number of
lines in a file?
Ans. wc – l
7. What command is used to display the characteristics of a process?
Ans. ps
8. What sign is used to back up over typing errors in vi?
Ans. #
9. What command is used to sort the lines of data in a file in alphabetical order?
Ans. sort
10. What port does squid listen, by default?
Ans. 3128
11. What command is used to list contents of directories?
Ans. ls
12. What command is used to copy directory structures in and out?
Ans. cpio
13. What command is used to remove jobs from the print queue?
Ans. lprm
14. What command is used to save the standard output in a file, as well as
display it on the terminal?
Ans. tee
15. What command is used to count just the number of lines contained in a file?
Ans. wc –l
16. What command is used to query for a specific package with RPM?
Ans. rpm –q
17. What command is used to change the working directory?
Ans. cd
18. What command is used to count the number of files in the current directory
by using pipes?
Ans. ls | wc - l
19. What command is used to count just the number of characters in a file?
Ans. wc – c
20. How can you rebuild the RPM file to include the new patches?
Ans. - - recompile
21. Which file is used to configure which file systems are mounted?
Ans. /etc/fstab
22. What of the following tool is used to check and repair Linux file systems?
Ans. fsck
23. What command is used to display and create files?
Ans. cat or touch
Example touch test1
24. Which of the following command can be used to rename a file in UNIX?
Ans. mv
Example mv training training1
25. What command is used to sort the lines of data in a file in reverse order?
Ans. sort – r
26. What command is used to print a file?
Ans. lp
27. The command chmod 761 letter is equivalent to
Ans. chmod u = rwx, g = rw, o = x letter
28. What command is used to halt a Linux system?
Ans. init 0
29. What can he used to set up a firewall on a Linux system?
Ans. ipchains
30. What shell's wild-card is used to match a single character?
Ans. ?
31. What command is used to copy a file?
Ans. cp
Example cp /etc/passwd
32. What command is used to display your current working directory?
Ans. pwd
33. To create an installation boot floppy disk from Linux (or another Unix)
machine, what command could you use?
Ans. dd
34. What command do you use to delete a file?
Ans. rm

List of files and dir- ls


File and dir properties- ll
cd /var/log
One step/dir back
cd . .
Back to previous dir
cd –

File create command- touch file1


Multiple files create with single command- touch test1 test2 test3
Multiple dir create with single command- mkdir dir1 dir2 dir3
File copy- cp file1 file2
File remove- rm file1
Move or rename- mv file2 file4
Copy directory- cp -r linux1 linux99
Delete dir- rm -r linux99
Delete dir with contains and without confirmation- rm -rf etc
Delete everything from current dir- rm -rf *

Some important Linux command in BUET exam


DESCO (AE)-2019
1. Rename a file test.docs to test.txt
Ans. move test.docs test.txt
2. Delete a file from a folder
Ans. rm test1
3. Read/Write permission to a file
Ans. chmode 666 test.txt
4. Find the MAC address using command
Ans. ifconfig

DESCO (SAE)-2019
1. Read/Write permission to a file
Ans. chmode 666 test.txt
2. Remove File & Folder
Ans. rm test and rm –r linux99
3. Show IP address
Ans. ifconfig/IP addr

Write a File create command in Linux (NPCBL-JTE-2019)


Touch file1
Cat file2

Write a Linux command for remove file .exe.txt (DTCA-AP-2019)


Ans. rm file.exe.txt

Prepared & Solved By:


G.M. Asiqur Rahaman
B.Sc in CSE
CCNA, MCSA, RHCSA
Officer (ICT)
Pubali Bank Limited
Head Office, Dhaka

You might also like