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

Linux Commands 1

This document provides information on file, directory, user, and group management in Linux. It outlines commands for creating, viewing, editing, and removing files and directories. It also discusses commands for adding, modifying, locking, unlocking, and viewing user accounts. Finally, it covers commands for creating, viewing, and modifying user groups and group membership.

Uploaded by

Muhammad Aslam
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Linux Commands 1

This document provides information on file, directory, user, and group management in Linux. It outlines commands for creating, viewing, editing, and removing files and directories. It also discusses commands for adding, modifying, locking, unlocking, and viewing user accounts. Finally, it covers commands for creating, viewing, and modifying user groups and group membership.

Uploaded by

Muhammad Aslam
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

LINUX

SYSTEM & NETWORK ADMINISTRATION


Lecture 3 & 4 by : Daima Nazim .
Topic : Management In Linux Environment
01 File Managemnet CONTENTS

02 Directory Mang.

03 User Management

04 Group Management
CASUAL COMMANDS

$ normal user

# root user

whoami to find in which user account you


are log in
su to switch user

pwd To find where I am or in which


directory we are
FILE MANAGEMENT
01
File Handing Commands

vi filename.extension To create file in directory

press Esc then :wq! command Saving procedure of file

cat filename.extension To view content of file

vi filename.extension To view file in text editor

rm filename.extension to remove file


DIRECTORY
02 MANAGEMENT
Directory Handling Commands

mkdir directoryname to make new directory


ls to display all contents in directory
ls -l to display detail view and
information about permissions
rm -r to remove directory with
all its contents

cd directoryname to change directory


cd .. For coming back from directory
USER MANAGEMENT
03
Users In Linux

adduser username To add user


useradd username

passwd username To set password of user


passwd -l To lock or disbale or inactive user account
usermod -L

passwd -u To unlock or enable or reactivate user account


usermod -U

passwd -d username to remove password of user account


CONTINUE....

passwd --status to verify account status

cat /etc/passwd | grep username see user home directory & other related info

usermod -d /directoryname to change directory of user


username
useradd -u 1003 username to create a user with specific userid

useradd -c “comment” username adduser with custom comments


usermod -c “comment” username add comment to existing user

tail -1 /etc/passwd to see commets


GROUP MANAGEMENT
04
Groups In Linux

groupadd group-name create a new group

tail -n5 /etc/group to view already existing groups

useradd -g PG.name -G SG.name username create a new user & assign a group
id username displays users groups

usermod -g PG.name username change user primary group

gpasswd -d username groupname remove a user from group

usermod -a -G group1 , group2 usrname add existing user to multiple groups

usermod -a -G groupname usrname add existing user to single group

*PG : primary group ; SG : secondary group

You might also like