Important Linux Command
Important Linux Command
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
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