Module 4 - Linux Fundamentals🌀.

➡️Command Syntax.

➡️Files and directory permissions(chmod).

how to remove or add permission?

➡️Permissions using numeric mode.

➡️File Ownership Commands(chown, chgrp).

➡️Access Control List (ACL).

What is ACL?
- ACL provides an additional, more flexible permission mechanism for file systems. It is designed to assist with UNIX file permissions. ACL allows you to give permissions for any user or group to any disc resource.

Use of ACL:
- Think of a scenario in which a particular user is not a member of group created by you but still you want to give some read or write access, how can you do it without making user a member of group, here comes in pictures Access Control Lists, ACL helps us to do this trick.
- Basically, ACLs are used to make a flexible permission mechanism in Linux.
- From Linux man pages, ACLs are used to define more fine-grained discretionary access rights for files and directories.
- Commands to assign and remove ACL permissions are:
setfacl and getfacl

List of commands for setting up ACL.

Display the ACL of a file or directory:

getfacl filename

Add or modify ACL entries:

For specific user:
setfacl -m u:username:permissions filename

For a specific group:
setfacl -m g:groupname:permissions filename

Remove a specific ACL entry:

For a user:

setfacl -x u:username filename

For a group:

setfacl -x g:groupname filename

Remove all ACL entries from a file or directory:

setfacl -b filename

➡️Help Commands.

➡️TAB Completion and Up Arrow Keys.

➡️Adding Text to FIles.

➡️Standard Output to a command.

  • tee filename → Writes output to file (overwrites existing content).

  • tee -a filename → Writes output to file (appends to existing content).

  • cat filename → Displays file content.

➡️File Maintenance Commands.

CommandDescription
cpCopies files and directories
rmDeletes files and directories (rm -r for directories)
mvMoves or renames files and directories
mkdirCreates a directory
rmdirRemoves an empty directory (rm -r for non-empty)
chgrpChanges the group ownership of a file/directory
chownChanges the owner and/or group of a file/directory

➡️File Display Commands.

CommandDescription
catDisplays the entire file content
moreDisplays file content page by page (forward only)
lessDisplays file content page by page with scrolling (forward and backward)
headShows the first 10 lines of a file (customizable)
tailShows the last 10 lines of a file (customizable, can track changes with -f)

➡️Cut - text processors commands.

➡️awk - text processors commands.

➡️grep/egrep - text processors commands.

➡️sort/uniq - text processors commands.

➡️wc - text processors commands.

➡️compress and un-compress.

CommandDescription
tar -cvf archive.tar file_or_directoryCreate an uncompressed archive
tar -xvf archive.tarExtract an uncompressed archive
tar -czvf archive.tar.gz file_or_directoryCreate a compressed .tar.gz archive
tar -xzvf archive.tar.gzExtract a .tar.gz archive
tar -tvf archive.tar.gzList contents of a .tar.gz file
gzip filenameCompress a file (filenamefilename.gz)
gzip -d filename.gz or gunzip filename.gzDecompress a .gz file

➡️Linux vs Windows Commands.

(If you have any questions or face issues, feel free to drop a comment below or mail me at birendra2783@gmail.com or watsapp msg on +977 9821508997)

0
Subscribe to my newsletter

Read articles from Birendra Kumar Chaudhary directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Birendra Kumar Chaudhary
Birendra Kumar Chaudhary

🌐 DevOps Enthusiast | Cloud & System Administrator | WordPress Expert With 2+ years of experience, I specialize in cloud infrastructure, server management, and WordPress development. At Appharu PVT. LTD., I optimize systems, reduce costs, and implement monitoring solutions. Experienced in deploying 50+ WordPress sites, AWS S3 integration, and troubleshooting technical issues, I’m focused on performance, security, and continuous learning in DevOps and automation.