Cloned from: Linux commands

Bookmark and Share

Front Back
mkdir  pg 183
takes arguments specifying the absolite or relativ e pathnames of the directories to create a subdirectory.

mkdir + a relative pathname

create directories
mv (move)pg 184
it requires 2 arguments at minimum: the source file/ directory and the target file/ directory.
moves/ rename files in a directory
cp (copy)pg 185
cp commanda takes two arguments at minimum
 to copy a directory full of files in Linux, you   must tell teh cp command that the copy will be recursive (-r).
are special variables in memory that point to commands.
displays BASH shell aliases
rm ( remove) pg 187
tales a list of aruments specifying the aabsolute or relative pathnames of a files to remove.
-i = interactively prompts the user to choose whether to continue with the deletion.
-f = to override theis choice and immediately delete the file.
rmdir ( remove directory)
it only removes a directory if it contains no files .
-r = you can remove a directory with all the files in it
locate command
used to locate files in a sys
find pg 189
the find command does not use the a premade index of files , but instead searches the directory tree recursively atarting from a certain deirctou of files that meet a certain criteria.
the format of the command is as follows:
find <start directory> -criteria <waht to find>
the which command searches directorurs taht are listed in a special variable calles the PATH variable in the current BASH shell.
PATH ( pg 191)
the path varialv elists derectorues that are searched for executables files if a realtive or absolute pathname was not spwcified when exevuting a command on the command line.
is the section that contains information about the filesystem in general, such as the number of inodes and data blocks, as well as how much data a data block sotes in Kilobytes.
Inode table
consists of several inodes ( information nodes). each inodedescribes one file or directory on the file system, and contains a unique idnode number for identification.
ln (pg 192)
is a command used to create a hardlink. need to specify 2 arguments: 1) the existing file to hard link 2) the target file taht will be created as a hard link.
hard link
are direct copies of one another, as they share the same inode and inode number. they all have the same size, and when one file is modified the other hard linked file are updates as well.
Symbolic link ( pg194)
are different than hard link because they do not sahre the same inode and inode number with their target file, one is merelu a poingter to the other and , thus, both files have different sizes.
view your current user name
to view your group membership and primary group.
creates an empty file
chown (pg 196)
( change owner command) changes ownership of a file or directory.
chgrp -pg 197
( change group) chage the group owner og a gile or directory.
  • for files- allows a user to opwn and read the contents aof a file.
  • directory- allowa a user to list the contents of the directory (if he has also been fiven execute permission)
  • for files - allows a user to open, read , and edit the contents of a file
  • for directories - allows a user the ability to add or remove files to a and from the directory (if he has also be given execute permission)
  • for files - allows a user the ability to execute the file in memory ( if it is a program file) and shell scripts.
  • for directories - allows a user the ability to enter the directory and work with directories contents.
it takes 2 arguments at minimum :
1- specifies the criteria used to change the permission
2- indicates the file name to change.
criteria used within the chmod command
see pg 202
x of y cards