Video Tutorial: Linux Command
Video Tutorial: Linux Command
Previous Job QnS on Linux Command
Topic Wise Question Bank
Linux Command
- ☆1Linux Command(a)Write Shell command which make a folder name 'A' with read permission access only.Janata, ASA, 21 | AME/ANE/AE
mkdir A chmod 400 A - ☆2Linux Command(b)Write Shell command which copy folder 'A' all information into folder 'P'. Folder 'A' and folder 'P's parent folder is same.Janata, ASA, 21 | AME/ANE/AE
cp -r A P
- ☆3Linux CommandLinux Command in ownership and group permission.Pubali, HE, 23 | Bank
Linux Ownership and Group Permissions
1.
chown(Change Ownership)The
chowncommand is used to change the owner and group of files or directories.Syntax:
chown [owner]:[group] [file/directory]Examples:
- Change the owner of a file:
chown username file.txt - Change both owner and group of a file:
chown username:groupname file.txt - Recursively change ownership for all files and subdirectories:
chown -R username:groupname /path/to/directory
2.
chgrp(Change Group Ownership)The
chgrpcommand changes only the group ownership of a file or directory.Syntax:
chgrp [group] [file/directory]Examples:
- Change the group of a file:
chgrp groupname file.txt - Recursively change the group for all files in a directory:
chgrp -R groupname /path/to/directory
- Change the owner of a file:
- ☆4Linux CommandExplain the meaning of chmod 750 backup.sh and chown root:admin backup.sh. Write a command to grant the owner read/write/execute permissions, the group read/execute permissions, and no permissions to others.CB, ANE, 2026 | Assistant Network Engineer
- ☆5Linux CommandWrite a Linux command to count the total number of characters and words from the first 10 lines of a file named wasacustomers.txt.Dwasa,AME,25 | Other
Command:
head -10 wasacustomers.txt | wc -mw
Explanation:
- head -10 wasacustomers.txt → Extracts the first 10 lines of the file.
- wc -m → Counts the total number of characters.
- wc -w → Counts the total number of words.
- | → Pipes the output of the head command to wc.
Therefore:
head -10 wasacustomers.txt | wc -mw
This command counts the characters and words from the first 10 lines of wasacustomers.txt.
- ☆6Linux CommandUnix command (directory listing with hidden files).SB & JB, ADA, 22 | ADA
Answer:
$ ls -al
- ☆7Linux CommandOthersState the exact administrative active performed by running the command chmod 755 script.sh on a linux target file.RAKUB, ANSE, 26 | AME/ANE/AE
Permission Breakdown:
755 means:
- Owner: 7 = read (r) + write (w) + execute (x)
- Group: 5 = read (r) + execute (x)
- Others: 5 = read (r) + execute (x)
Administrative Action:
- Grants full control (rwx) to the file owner
- Grants read and execute permission to group users
- Grants read and execute permission to all other users
