O'Reilly logo

Linux® For Dummies®, 8th Edition by Richard Blum, Dee-Ann LeBlanc

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Files and Filesystem

No matter which operating system you’re using, it’s hard to do anything without being able to find your way through and work with the filesystem. The following utilities help you find your way:

File organization

Boxing, packing, sorting, shipping — I’m always shuffling files around on my system. File organization commands provide tools for moving files and filesystem units around, as shown in Table A-4.

Table A-4. File Organization Tools
CommandPurpose
cdChanges directories.
cpCopies a file.
dfShows partitions and how much space they have.
duShows how much disk is being used in the current directory and below.
lnCreates a shortcut.
lsLists the contents of a directory or information about a file.
mkdirCreates a directory.
mvMoves or renames a file.
pwdShows the path for the directory you’re currently in.
rmDeletes a file.
rmdirDeletes an empty directory.

File attributes

Files are much like candy bars. The wrappers provide information about the ingredients, size, and package date — all descriptive of the tasty nugget inside. (Perhaps the wrapper is even childproof.) Files keep all this wrapper information in an inode. Along with the capability to change file inode information, these commands can return data about the content of the file, as shown in Table A-5.

Table A-5. File Attributes Commands
CommandPurpose
chgrpChanges the group associated with a file
chmodChanges a file’s permissions
chownChanges who owns a file
fileShows what type of file you’re dealing with
statShows ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required