- Home Directory
~
- See all files in the current Directory
ls
- See in which Directory you are currently now
pwd
- Clear Console
clear
Navigation Commands
- Change Directory
cd
- Traverse back to Directory
cd ..
Root Vs Home Directory
- Root Directory
/
- Home Directory
~
Absolute vs Relative Path
- Absolute
- Relative Path
Create a new Directory
mkdir dir
Flags
Flags are the additional command embedded with the commands to show more in the directory (Hidden folders/files)
ls -l
ls -a
Create a New file
touch filename
Delete Files/Folders
- Delete files
rm - filename
Delete Folders
- Empty Folder
- Folder with files
I am a Web Developer & enjoy working on challenging projects, which is what makes this job so rewarding. You can reach out to my My Portfolio Site. I hope this article will helpful
Top comments (11)
The
touch
command isn't actually for creating new files. It's for updating the access and modification times of the specified file or files. The fact that it creates the file if it doesn't exist is merely a convenient side effect.Yes. You're right that the
touch
command didn't intend to create the new files, If files already exist then we can access & modification the file otherwise it'll create a new fileIt's not a command, per se, but the up/down arrow functionality is something everyone should know. Toggles through previously entered commands. This is very handy if you're doing the same tasks several times over (avoids extra typing) and is helpful in reviewing what you've done in the event that it didn't work as intended.
Bro, you just changed my life
And then you become addicted to it like me and press 11 times the up arrow to find back a
ls
:DAgreed with @kwnaidoo, also it is good to understand the concepts of Redirections when using UNIX commands, that would be a good follow-up post of more advanced topics as well as using pipes like
ps aux | grep python
.This article is helpful but in my opinion it could've been much helpful if you mentioned Git commands
I'll post another article related to Git commands
This is a good introduction
In addition to Mac, these will also work in Linux. A subset also works with Windows command line interfaces too (Cmd/PowerShell).