Directories

From SHellium Wiki
Jump to: navigation, search
Geographylogo.png In other languages: English | Afrikaans | Albanian | Arabic | Brazilian | Bulgarian | Catalan | Chinese | Croatian | Czech | Danish | Dutch | Esperanto | Estonian | Filipino | Finnish | Flemish | French | German | Greek | Hebrew | Hindi | Hungarian | Indonesian | Italian | Japanese | Latvian | Lithuanian | Macedonian | Malay | Malayalam | Norwegian (Bokmål) | Norwegian (Nynorsk) | Persian | Polish | Portuguese | Romanian | Russian | Serbian | Slovak | Slovenian | Spanish | Swedish | Turkish | Ukrainian | Urdu

Contents

Making and removing directories.

Make a directory.

  • The command to make a directory is mkdir:
mkdir <directory>

If you need to make multiple directories inside each other, use the -p option:

mkdir -p some/long/directory/structure

Remove a directory.

To remove an empty directory, use rmdir:

rmdir <directory>

To remove a directory that has files:

rm -r <directory>

To do remove the directory, any subdirectories, and all contents without confirmation:

rm -rf <directory>

Disk Space.

If you want to know how much disc space you are using in your $HOME, use du:

du -sh ~

Or, to see how much you're using within a particular folder:

du -sh /path/to/folder

Disk Space on Devices.

If you want to know how much disc space left on devices:

df -h

Back-up and Restore

We’ve all made mistakes during our configuration and at some point wish we could go back in time before the mistake. Now that you have the ultimate setup that you’ve worked so hard on, how are you going to be sure you have the same setup after a system or hard drive crash? The easiest method would be to use a simple tar command, see the examples below or see man tar.

Create a gzipped tarbarll:

tar -czvf BackupFile.tar.gz /path/to/backup
  • Restore from a tarball by going to the parent directory (where you want your restored directory to live), then unpack the archive:
cd /path/to/dir
tar -xvzf BackupFile.tar.gz
Personal tools
Namespaces

Variants
Actions
Navigation
Indexes
SHellium Sites
Toolbox