NWP lab1 Flashcards
pwd
Print the working directory you are in
cd ..
Return directly to its home directory
ls
List all files in the working directory
ls –rtl
Display detailed information about all files in the working directory and sort by their modification time in ascending order.
ls –l
Display detailed information about all files in the working directory.
- Column 1: The permissions on the particular file for user, group and others,
- Column 2: The number of files contained in the particular directory.
- Column 3: user
- Column 4: group
- Column 5: the size of the file in KB.
- Column 6: month and day at which the file was created or last modified.
- Column 7: the name of the file
cd
Change the working directory to your home directory
mkdir test
Short for make directory. Used to create directories.
rmdir test
Short for remove directory. Used to remove/ delete directories.
- *chmod commands:**
- *The way to use this format:**
chmod [newpermission] [filenames]
The following are symbolic parameters used by the command chmod
u
User (yourself)
g
Group
o
others (rest of the world)
a
All of the above (u,g and o)
-
Remove this permission
+
Add this permission
r
Read access
w
Write access
x
Execute access
To better understand the chmod command you must divide the first column into parts:
Lets take -r–r–r– as an example the first part _-_r–r–r– shows what kind of file it is. The table to the right shows each symbol with its meaning. In this case it is a file. The other part is -_r–_r–r– this shows the permissions for the user. -r–_r–_r– this shows the permissions for the group. And finally -r–r–r– this shows the permissions for others.
-
File
c
Character device file
d
Directory
l
Symbolic link or shortcuts
chmod g-r test
Remove read access from group
chmod o-r test
Remove read access from others (the rest of the world)
chmod go-x test
Remove Execute access from group and others
chmod u-rwx test
Remove read, write and execute access from user (yourself)
chmod uog+rwx test
Add read, write and execute access to user, group and others
who
Get information on currently logged in users.
- Column 1: user name
- Column 2: show how the user is connected. tty means the user is connected directly to the computer, while pts means the user is connected from remote.
- Column 3 & 4: date and time
- Column 5: show IP address where the users are connected.
ps –ef
See processes on the system. Pipes the output to “less” to make it scrollable. Divide the output to pages.
ps –fu user4
See processes on user 4 system
touch file4
Create new, empty file