Feb
23
Manipulate Files Directories using Unix Shell
February 23, 2008 |
This article continues from the previous article about using Unix Shell (command line) to operate Unix-like operating systems like Linux Ubuntu. We will see how to use Unix Shell to create, rename, move and delete files and directories.
To create a directory from the command line, type the mkdir command followed by the name of the directory, let’s create a directory called bollocks
mkdir bollocks
Use the mv command to move a file or directory to a different directory, or to rename it in its current directory. To rename the bollocks directory you created to sex_pistols you can use:
mv bollocks sex_pistols
If you wanted to move the sex_pistols directory inside the Desktop directory, you would just specify the Desktop directory as the second argument:
mv sex_pistols Desktop/
The rm command removes files, and rmdir removes directories. Just use the commands followed by the files or directories to remove, respectively:
rm Desktop/sex_pistols/
bodies.mp3
rmdir Desktop/sex_pistols/
You can also remove a directory and all files and directories inside of it by running rm -r followed by the name of the directory.
Notice: Be careful when you recursively delete a directory with this command that you do in fact want to remove all of the files within. Once removed via the command line, there’s no trash bin to retrieve them from.
Similar Posts
- Install and Play Quake 4 on Ubuntu
- SCIM Filesystem Name Rename Problem
- Install and Play Quake 2 on Ubuntu
- Install and Play Quake III Arena on Ubuntu
- Install and Configure phpMyAdmin on Ubuntu LAMP
- Install and Play Diablo II on Ubuntu
- Install and Play Red Alert 2 on Ubuntu
- Install and Play Counter Strike on Ubuntu
- Install Photoshop on Ubuntu
- Linux Ubuntu Install Setup PHP cURL
- Create a Subdomain Virtual Host on Ubuntu
- Virus on Ubuntu Wine
- Install and Play Enemy Territory Quake Wars on Ubuntu
- Burn Blu-Ray Disc on Ubuntu
- Create Compile and Run .NET on Ubuntu
- Install and Configure LAMP on Ubuntu
- Install Google Earth on Ubuntu
- Play iTunes m4a Files on Linux Ubuntu
- Install IE6 using IEs 4 Linux on Ubuntu
- Create Read View Edit Excel File on Ubuntu
- Install Run and Play Doom 3 on Ubuntu
- Ubuntu Hardy Broadcom Wireless Setup
- Burn Audio CD on Ubuntu
- Create Read View Edit Word Document on Ubuntu
- Ubuntu Best CHM Viewer
- Ubuntu Configure Disable Touchpad
- Install Flash CS on Ubuntu
- Install and Configure Wine on Ubuntu
- Transfer music mp3 to and from iPod Ubuntu
- Install and Play Unreal Tournament on Ubuntu
- Ubuntu Seperate Audio From Video
- Use IRC to Chat on Ubuntu
- Install and Chat use QQ on Ubuntu
- Use MySpaceIM to Chat on Ubuntu
- Switch Ubuntu Server to Desktop
- Ubuntu Change Password
- Install and Use Google Talk to Chat on Ubuntu
- Install BitTorrent GUI Azureus on Ubuntu
- Install and Use Skype on Ubuntu
- Install Java Plugin on Ubuntu Firefox
- Ubuntu Convert Ogg Flac to mp3
- Install and Use Audacity on Ubuntu
- Use AIM to Chat on Ubuntu
- Make Acer Extensa headphone speakers Work on Ubuntu
- Use Bonjour to Chat on Ubuntu
- Install Use ICQ on Ubuntu
- Connect to and Use SILC on Ubuntu
- Use Yahoo Messenger on Ubuntu
- Connect to and Use SIMPLE IM to Chat on Ubuntu
- Connect to and use XMPP on Ubuntu
Comments
1 Comment so far



































very useful article, thanks for posting it out!