snifhex / bash-for-beginners

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bash-for-beginners

Linux command

  • Create a file using bash command: touch <filename>

Usage: Hello World In Bash Shell

var="Hello World"

print it

echo "\$var"

Basic Bash commands

pwd : pwd stands for print working directory and it points to the current working directory

pwd

ls : ls stands for a list and it lists the contents of a directory

ls

cd : cd stands for Change Directory and changes the active directory to the path specified

cd

mkdir : mkdir stands for Make directory and is used to make a new directory or a folder

mkdir Demo

mv : mv stands for Move and it moves one or more files or directories from one place to another

mv Demo/*.py Demo/Pythonfiles

touch : The touch command is used to create new, empty files

touch foo.txt

rm : rm stands for Remove and it removes files or directories

rm foo.txt

rmdir : rmdir stands for remove directory and is used to remove empty directories from the filesystem

rmdir ../Pythonfiles/

About