DEV Community

Cover image for Linux Basics

Linux Basics

Rudrakshi on January 12, 2021

Linux is a family of open-source Unix-like operating systems based on the Linux kernel developed by Linus Torvalds. It’s essential for a software d...
Collapse
 
cmuralisree profile image
Chittoji Murali Sree Krishna • Edited

Nice, but misses out few

Like:

mkdir directoryname
# Make directory
touch filename
# Make files
cd dirname
# Changing the directory
cd ..
# Going back to previous directory
cd
# Going to home Directory
mv filename /Directory/filename 
# It will move the file from somewhere to other
cp filename /directory/filename 
# It will copy the file from on to other
less filename
# This will print contents inside the file but only one page per time
ls -a && ls -al
# Prints all the files or folders inside directory even the hidden ones, same prints permissions for all even for hidden
man command
# To see manual-pages of the command or another way for command --help
locate filename 
# To locate the file 
df
# Used to see disk space to see space in megabytes df -m
uname -a
# See the distro details
hostname
# To see the name of the host or wifi
hostname -i
# To see ip address
chmod
# chmod +x filename to make file executable or chmod 777 filename to give file root permission 
Enter fullscreen mode Exit fullscreen mode

There might be more but these were upto my knowledge

Collapse
 
shrihankp profile image
Shrihan

touch command is the most basic one which many people misunderstand. The touch command is used to modify timestamps on a file, but it actually gives the effect of creating a new file.

Collapse
 
cmuralisree profile image
Chittoji Murali Sree Krishna

touch filename - will create an empty file
touch -a filename - change the access time only
touch -c filename - if the file does not exist, do not create it
touch -d filename - update the access and modification times
touch -m filename - change the modification time only
touch -r - use the access and modification timestamp of file
touch -t - creates a file using a specified time

it creates a file and also can modify the timestamps

Thread Thread
 
shrihankp profile image
Shrihan

Exactly!

Thread Thread
 
cmuralisree profile image
Chittoji Murali Sree Krishna

most of the people will not use these options & they won't bother about timestamps, so I haven't mentioned them previously.

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thanks for sharing this!

Collapse
 
ojuswizard profile image
OjusWiZard

Very Informative!
A great one to get some high-level understanding.

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thank you, Ojus :)
Am glad you liked it.

Collapse
 
epsi profile image
E.R. Nurwijayadi

Go details with linux diversity:

πŸ•· epsi-rns.github.io/system/2020/10/...

Linux Diversity

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thanks for sharing this!

Collapse
 
sourabhsnath profile image
Sourabh S Nath

Beyond software development, I ask everyone to try and use a Linux distro as their primary desktop os. Benefits range from simple performance improvements to much better respect for your privacy in comparison to windows.

Collapse
 
rudrakshi99 profile image
Rudrakshi

Yes, exactly!

Collapse
 
chanduthedev profile image
chanduthedev

Permission values are 1,2 and 4 as shown below and why not 3 after 1 and 2?
4 β†’ read permission
2 β†’ write permission
1 β†’ execute permission
This is basing on the power of two, starting from zero.

2*0 = 1 β†’ execute permission
2
1 = 2 β†’ write permission
2
*2 = 4 β†’ read permission
Due to this logic, there is 4 and not 3.

This will help to remember permission values easily.

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thanks for sharing this!

Collapse
 
pranavvhankate profile image
Pranav Vhankate

Really a good article for beginners for those who don't know the basics of Linux, like me! Thank you very much for providing this article!!!
:-)

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thanks, glad to hear that.

Collapse
 
shwetabh1 profile image
Shwetabh Shekhar

Quite Informative. Great going Rudrakshi!

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thank you!
Am glad you liked it.

Collapse
 
anubhavitis profile image
Anubhav Singhal

Nice work, Rudrakshi!

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thank you :)

Collapse
 
plazzy99 profile image
Vatsal kesarwani

Good start Rudrakshi

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thank you :)

Collapse
 
waylonwalker profile image
Waylon Walker

File permissions have tripped up even the most seasoned user.

Collapse
 
rudrakshi99 profile image
Rudrakshi

oh yes..

Collapse
 
parthsharmajss profile image
ParthSharma-jss

Nice post on fundamentals of Linux. Keep sharing such amazing posts.

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thanks, Parth :)
Am glad you liked it.

Collapse
 
geekquad profile image
Aditya Kumar Gupta

Amazing article πŸ‘

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thank you so much :)

Collapse
 
ethanosullivan profile image
Ethan O'Sullivan

This is a staple starting guide for those who are getting into Linux like myself.

Collapse
 
rudrakshi99 profile image
Rudrakshi

Thanks, glad to hear that!