Part 1 – Intro linux tips
“There is no better way to learn Linux than by immersing oneself in the operating system itself. To achieve this, I installed Ubuntu on my wife’s old notebook and connected it to my second monitor. This allowed me to alternate between using my MacBook with two monitors and the Ubuntu system, providing me with a valuable hands-on learning experience.”
Additionally, I enrolled in a Linux class, although I found myself spending most of the class time experimenting with Ubuntu. The class did offer one crucial benefit – access to a remote server. While Linux can be utilized on desktops, it is primarily designed for servers. If you lack access to a remote server, Cloudron is a great starting point.
Useful commands in Linux.
ls– This is the command to list all the files in a directory.
ls -a– The
-aoption lists all files in the directory.
ls -l filename.txt– This is like showing details in Finder.
file– This awesome command will identify a file type.
file ls– This will tell you that “ls” is a 64-bit Linux standard binary.
cd– This will take you back to your home directory.
cd ..– This will take you down one directory.
cd /– This will take you to the root directory.
/bin/marklarwill take you there too.
cd $HOME/marklar– This interesting command unwraps the variable
$HOMEand appends it.
pwd– This displays the full path name, fully qualified path name, or absolute pathname.
pwd $HOME– This displays the full path of
which– This will tell you the location of a system command. Commands could be stored in many places, like
/sbin(system admin commands) are all standard locations.
cal– This displays the date.
man man– This talks about the command called
man cal– This tells you how to use
man -k pwd– This shows all the different
man -2 pwd– This gives you an alternate
- Magic! You can use this symbol (without quotes) to populate a file with data:
>. For example,
uname > marklar.txtputs
unameoutput text into the
vi– This gets its own post, but use
ESC :Q!to exit.
head filename– This will display the first 10 lines of a file.
tail filename filename– This will display the last 10 lines of both files.
cat– This command is short for “concatenate,” so originally it would combine two files.
cat file1 file2 > destination_file– This combines both of these files into one.
cat file1– This just prints the contents of that file to the screen.
pbcopy– This copies the output to the clipboard
After learning about these Linux commands, you are on your way to becoming a Linux expert! Best of luck on your journey, and I hope that these commands provide you with a solid starting point.