0% found this document useful (0 votes)
29 views

Command Line Essentials: The Commands: Where Am I? What's Here?

This document provides examples of common Linux commands for navigating directories, viewing file contents, manipulating files and folders, running scripts, and customizing the bash environment. It demonstrates commands like pwd, ls, cd, touch, mkdir, rm, cat, less, echo, which, clear, exit, chmod and source among others, showing their basic usage and effects. The goal is to familiarize the user with essential Linux command line tasks and operations.

Uploaded by

NN14
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Command Line Essentials: The Commands: Where Am I? What's Here?

This document provides examples of common Linux commands for navigating directories, viewing file contents, manipulating files and folders, running scripts, and customizing the bash environment. It demonstrates commands like pwd, ls, cd, touch, mkdir, rm, cat, less, echo, which, clear, exit, chmod and source among others, showing their basic usage and effects. The goal is to familiarize the user with essential Linux command line tasks and operations.

Uploaded by

NN14
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Command Line Essentials: The Commands

Where Am I? What's Here?


pwd
ls
ls -l

Change Directory
pwd
ls -l
cd Videos/
pwd
cd ..
pwd
cd My\ Documents/
pwd
cd ../../..
ls -l
cd ~
cd ../..
cd
cd /c/Windows/System32/
pwd
cd

Where is that command?


which ls
which man

Echo...Echo
echo "Hello World"
echo $PATH
echo "The current path is $PATH"

Reviewing Files Contents


cat test.txt
less test.txt

Create, Rename, and Delete Files


pwd
ls
touch demo.txt
ls
mv demo.txt demo-1.txt
ls
rm demo-1.txt
ls
ls -l
touch test.txt
ls -l

Create and Delete Folders


pwd
mkdir projects
cd projects/
pwd
cd ..
rmdir projects
cd projects
ls
mkdir -p projects/client-a/awesome-web-project
cd projects/client-a/awesome-web-project
cd
rmdir projects
rm -rf projects/
ls

Clear and Exit


ls -l
clear
exit

Output to a File
pwd
echo "hello there" >> demo.txt
ls
cat demo.txt
echo "hello again" >> demo.txt
cat demo.txt
echo "HI" > demo.txt
cat demo.txt
clear
ls -al > listing.txt
cat listing.txt

Creating and Executing a Simple Bash Script


pwd
which bash
notepad++ example.sh
ls -al
chmod +x example.sh # example only, not needed this time
./example.sh

Customizing the Bash Environment


notepad++ .bashrc
source .bashrc
ll
npp
# Close Git Bash
ll
npp

You might also like