Skip to content

NoXXXwill/notes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Repository for useful notes

Created 2 branches for testing pull requests

Bash Cheat Sheet

Basic Commands

  • pwd - Print the current working directory.
  • ls - List files in the current directory.
    • ls -l - Long format.
    • ls -a - Show hidden files.
  • cd - Change directory.
  • mkdir - Create a new directory.
  • rm - Remove a file.
    • rm -r - Remove a directory and its contents.
  • cp - Copy files or directories.
  • mv - Move or rename files or directories.

File Viewing

  • cat - Print the contents of a file.
  • less - View file contents page by page.
  • head - Show the first 10 lines of a file.
  • tail - Show the last 10 lines of a file.
    • tail -f - Follow a file as it grows (e.g., logs).

Permissions

  • chmod - Change file permissions.
    • Example: chmod 755 script.sh
  • chown : - Change the owner of a file.

Variables

  • VAR=value - Define a variable.
  • $VAR - Access a variable's value.
  • export VAR=value - Make a variable available to child processes.

Loops and Conditionals

For Loop

for i in {1..5}; do
  echo "Iteration $i"
done

About

Contains useful readme docs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages