Basic Unix Commands Every Developer Should Know

Basic Unix Commands Every Developer Should Know
BASIC UNIX EVERY DEVELOPER SHOULD KNOW

Basic Unix Commands Every Developer Should Know

A compact reference to the most useful Unix commands for developers and Salesforce engineers. Copy, paste, and practice these commands directly in your terminal.

For Salesforce & backend developers Beginner friendly Works on macOS & Linux

Unix commands help you move faster in projects, debug issues, and work with repositories without relying only on a GUI. If you are a Salesforce, backend, or full-stack developer, knowing these basics will save you a lot of time in the terminal.

Below is a simple one-page guide you can use as a quick reference while working.

Detailed Commands and Examples

1. pwd — Print Working Directory navigation

Shows the full path of the folder you are currently in. Very helpful when you feel lost in the terminal.

pwd
2. ls — List Files and Folders files & folders

Displays all files and directories inside the current folder.

ls

Common options:

ls -l   # long format with details
ls -a   # show hidden files
3. cd — Change Directory navigation

Used to move between folders. You can also use the up and down arrow keys in the terminal to browse previous commands.

cd <folder-name>   # go into a folder
cd ..              # go one level up
cd ../             # same as above, go one level up
cd ~               # go to your home directory
cd /path/to/folder # go to a specific path
4. mkdir — Create a Directory project setup

Creates a new folder (directory) inside your current location.

mkdir myProject
mkdir src
mkdir logs
5. touch — Create a File files

Creates a new empty file. Very useful for quick script or config file creation.

touch index.js
touch test.cls
touch README.md
6. open — Open a File (macOS) open file

Opens a file or directory with the default application (mainly on macOS).

open index.js
open myProject/
7. rm — Remove Files delete

Deletes one or more files from the current directory.

rm file.txt
rm app.log
Warning: rm deletes permanently (no recycle bin).
8. rm * — Remove All Files in a Folder delete all

Removes all files (not folders) in the current directory.

rm *
Be very careful: this will delete every file in the folder you are currently in.
9. rm -r — Remove a Directory delete folder

Deletes a directory and its contents recursively.

rm -r directoryName/
rm -r logs/
Use with caution: there is no undo for this command.
10. cp — Copy Files and Folders copy

Copies files or directories from one location to another.

cp file1.txt file2.txt          # copy file1.txt to file2.txt
cp -r folder1 folder2           # copy folder1 into folder2
11. mv — Move or Rename Files move / rename

Moves files between folders or renames them.

mv oldName.txt newName.txt   # rename a file
mv file.txt folder/          # move file.txt into folder
mv *.log logs/               # move all .log files into logs/
12. cat — Show File Contents view file

Prints the contents of a file directly in the terminal.

cat myfile.txt
cat config.json
13. grep — Search Text in Files search

Searches for specific text inside files. Helpful when scanning Salesforce metadata or log files.

grep "trigger" *.cls       # search for the word "trigger" in all .cls files
grep "ERROR" app.log       # find lines containing "ERROR" in app.log
14. echo — Print Text output

Prints text to the terminal. Often used while writing scripts.

echo "Hello World"
echo "Deploying Salesforce metadata..."
15. code . — Open Folder in VS Code vs code

Opens the current directory in Visual Studio Code (after you have installed the code command in PATH).

code .
```

Comments

Popular posts from this blog

Understanding Note and ContentNote Objects in Salesforce

OOPS in Apex

System administrator gets logged out when they use 'Login as User'