⚡ OPENDEV HUB V1.0⚡ API STATUS: 100% OPERATIONAL⚡ CLIENT ENGINE: LOADED & CACHED⚡ TRENDING TECH: TAILWIND V4, NEXT.JS 16, RUST, GO⚡ ZERO AUTH REQUIRED
OPENDEVHUB

Command Palette

Search for a command to run...

BASH REFERENCE

LINUX & BASH SHELL COMMAND REFERENCE

An offline-first search index for standard Unix commands, permission mappings, text stream pipelines, redirection rules, and process automation syntax.

File System Operations8 ENTRIES

lsFile System Operations

List directory contents. Often used with flags to see hidden files or file details.

SYNTAX:
ls [flags] [directory]
EXAMPLE USAGE:
ls -la /var/log
COMMON PITFALL:

Running ls in a folder with millions of files without pagination or limit, causing the terminal output buffer to freeze.

cdFile System Operations

Change the shell working directory to a specified path.

SYNTAX:
cd [directory]
EXAMPLE USAGE:
cd /var/www/html
cd .. # Go up one level
cd ~ # Go to home directory
COMMON PITFALL:

Using 'cd' inside an automated shell script without checking if the target directory exists, leading to subsequent commands executing in the wrong folder.

pwdFile System Operations

Print name of current/working directory.

SYNTAX:
pwd
EXAMPLE USAGE:
pwd
COMMON PITFALL:

Confusing the current working directory in script execution with the directory where the script file is located.

mkdirFile System Operations

Create one or more new directories.

SYNTAX:
mkdir [flags] <directory_name>
EXAMPLE USAGE:
mkdir -p project/src/components # Creates nested folders if they do not exist
COMMON PITFALL:

Attempting to create nested directories without the '-p' flag, resulting in a 'No such file or directory' error.

cpFile System Operations

Copy files and directories from source to destination.

SYNTAX:
cp [flags] <source> <destination>
EXAMPLE USAGE:
cp config.env.example config.env
cp -R src/ backup/src_backup/ # Recursive copy
COMMON PITFALL:

Forgetting the '-R' or '-r' flag when copying directories, which silently ignores folders or throws an error.

mvFile System Operations

Move or rename files and directories.

SYNTAX:
mv <source> <destination>
EXAMPLE USAGE:
mv oldname.txt newname.txt
mv file.txt /tmp/trash/
COMMON PITFALL:

Accidentally overwriting an existing file at the destination. Use the '-n' flag to prevent overwriting or '-i' for interactive confirmation.

rmFile System Operations

Remove files or directories. Use recursive flag to delete folders.

SYNTAX:
rm -rf <path>
EXAMPLE USAGE:
rm -rf ./tmp/cache
COMMON PITFALL:

Running 'rm -rf /' or omitting path configurations, which can permanently wipe out the system filesystem.

findFile System Operations

Search for files in a directory hierarchy based on names, types, sizes, or dates.

SYNTAX:
find [path] -name "<pattern>"
EXAMPLE USAGE:
find . -type f -name "*.log" -mtime -7
COMMON PITFALL:

Forgetting to wrap the name pattern in quotes, which causes the shell to expand the glob pattern locally before running find.

File Permissions2 ENTRIES

chmodFile Permissions

Change the access permissions of files or directories (read, write, execute).

SYNTAX:
chmod [permissions] <file>
EXAMPLE USAGE:
chmod 755 script.sh
chmod +x deploy.sh
COMMON PITFALL:

Setting 'chmod 777' on files in production, which gives global write and execute access, creating severe security vulnerabilities.

chownFile Permissions

Change file owner and group ownership of files and directories.

SYNTAX:
chown [owner]:[group] <file>
EXAMPLE USAGE:
chown -R www-data:www-data /var/www/html
COMMON PITFALL:

Forgetting the -R flag when you want to change ownership for all nested files and subdirectories.

Pipelines & Redirection2 ENTRIES

stdout & stderr redirectPipelines & Redirection

Redirect command standard output (stdout) or standard error (stderr) to a file or stream.

SYNTAX:
<command> > file.txt 2>&1
# Append stdout:
<command> >> file.txt
EXAMPLE USAGE:
npm run start > output.log 2>&1 &
COMMON PITFALL:

Using '>' when you mean to append. '>' will overwrite the file entirely, destroying previous logs. Use '>>' to append.

xargsPipelines & Redirection

Build and execute command lines from standard input (useful for chaining output files to arguments).

SYNTAX:
find . -name "*.tmp" | xargs rm
EXAMPLE USAGE:
cat ips.txt | xargs -I {} ping -c 1 {}
COMMON PITFALL:

Forgetting that xargs splits on spaces/newlines, which can fail or cause issues if filenames contain spaces. Use 'find -print0 | xargs -0' to solve this.

Process Control4 ENTRIES

psProcess Control

Report a snapshot of current running processes in the system.

SYNTAX:
ps [flags]
EXAMPLE USAGE:
ps aux | grep node
COMMON PITFALL:

Running ps without proper flags and assuming a process isn't running, when it's actually running under a different user or session.

killProcess Control

Send a signal to a process (usually to terminate or kill it by PID).

SYNTAX:
kill [-signal] <pid>
EXAMPLE USAGE:
kill -9 12345
COMMON PITFALL:

Using 'kill -9' (SIGKILL) immediately. Always try 'kill -15' (SIGTERM) first to allow the process to clean up connection resources and write files.

nohupProcess Control

Run a command immune to hangups, allowing background processes to continue running even after you log out of the SSH session.

SYNTAX:
nohup <command> > output.log 2>&1 &
EXAMPLE USAGE:
nohup node server.js &
COMMON PITFALL:

Forgetting to add '&' at the end, which keeps the process in the foreground instead of putting it into the background.

top / htopProcess Control

Interactive, real-time process monitoring display of system activity and resource consumption.

SYNTAX:
top
htop
EXAMPLE USAGE:
htop
COMMON PITFALL:

Leaving high-frequency monitoring tools like top running in multiple ssh terminals, which itself consumes non-trivial CPU cycles.

Text Processing & Searching6 ENTRIES

grepText Processing & Searching

Search text for lines matching a pattern. Supports regular expressions.

SYNTAX:
grep [flags] <pattern> [file]
EXAMPLE USAGE:
grep -rn "error" /var/log/nginx/
grep -E "^[0-9]{1,3}\\." log.txt
COMMON PITFALL:

Searching large binary files or node_modules directories without excluding them, resulting in massive terminal outputs.

sedText Processing & Searching

Stream editor for filtering and transforming text (e.g. search and replace).

SYNTAX:
sed 's/<search>/<replace>/g' <file>
EXAMPLE USAGE:
sed -i 's/PORT=3000/PORT=8080/g' .env # Modifies the file in-place
COMMON PITFALL:

Using '-i' (in-place modification) without first running sed without '-i' to preview and verify changes.

awkText Processing & Searching

A versatile pattern scanning and processing language, highly useful for extracting columns from logs/command outputs.

SYNTAX:
awk '<pattern> {action}' [file]
EXAMPLE USAGE:
ps aux | awk '{print $2, $11}' # Prints PID and command columns
COMMON PITFALL:

Confusing field separators (default is whitespace) when parsing CSV files without specifying '-F ","'.

catText Processing & Searching

Concatenate and display file contents in the terminal.

SYNTAX:
cat [file]
EXAMPLE USAGE:
cat /etc/nginx/nginx.conf
COMMON PITFALL:

Using 'cat' to view extremely large files (e.g., gigabyte log files), which floods the terminal buffer. Use 'less' or 'tail' instead.

tailText Processing & Searching

Output the last part of files. Often used to watch logs in real-time.

SYNTAX:
tail [flags] <file>
EXAMPLE USAGE:
tail -f -n 100 /var/log/syslog # Follow logs as they grow
COMMON PITFALL:

Running 'tail -f' on log-rotated files; if the target file is renamed (rotated), tail might stop displaying new lines. Use '--follow=name' if supported.

headText Processing & Searching

Output the first part (lines) of files.

SYNTAX:
head -n <number_of_lines> <file>
EXAMPLE USAGE:
head -n 20 package.json
COMMON PITFALL:

Omitting the number of lines when you want to view a specific amount (default is 10 lines).

System Information & Disk Usage4 ENTRIES

dfSystem Information & Disk Usage

Report filesystem disk space usage for all mounted drives.

SYNTAX:
df [flags]
EXAMPLE USAGE:
df -h # Human-readable format (MB/GB)
COMMON PITFALL:

Ignoring disk space consumption alerts and failing to inspect inode exhaustion ('df -i'), which can freeze systems even if disk space is free.

duSystem Information & Disk Usage

Estimate file space usage recursively for directories.

SYNTAX:
du [flags] [path]
EXAMPLE USAGE:
du -sh * # Show total size of each file/folder in current directory
COMMON PITFALL:

Running raw 'du' on the root directory `/` without limiting depth or using '-h', causing endless screens of details.

freeSystem Information & Disk Usage

Display amount of free and used physical memory (RAM) and swap in the system.

SYNTAX:
free [flags]
EXAMPLE USAGE:
free -h --si
COMMON PITFALL:

Misinterpreting the 'available' memory. Linux utilizes unused RAM for buffers/cache; look at 'available' rather than 'free' to gauge actual capacity.

unameSystem Information & Disk Usage

Print system kernel, OS, and machine architecture details.

SYNTAX:
uname [flags]
EXAMPLE USAGE:
uname -a # Print all system details
COMMON PITFALL:

Assuming all architectures are the same and downloading incompatible binaries (e.g. x86_64 vs arm64).

Network & Connectivity5 ENTRIES

curlNetwork & Connectivity

Transfer data from or to a server using supported protocols (HTTP, HTTPS, FTP, etc.).

SYNTAX:
curl [flags] <url>
EXAMPLE USAGE:
curl -X POST -H "Content-Type: application/json" -d '{"key":"val"}' https://api.example.com
curl -o app.tar.gz https://example.com/app.tar.gz
COMMON PITFALL:

Running curl on HTTPS sites with expired/invalid certificates using '-k' (insecure) flag in production environments, exposing traffic to MITM attacks.

wgetNetwork & Connectivity

Non-interactive network downloader. Great for downloading files recursively.

SYNTAX:
wget [flags] <url>
EXAMPLE USAGE:
wget -c https://example.com/largefile.zip # Resume partial download
COMMON PITFALL:

Using wget to pull files without limiting retry counts or timeouts on flaky networks, resulting in hung automation scripts.

pingNetwork & Connectivity

Send ICMP Echo requests to verify host connectivity.

SYNTAX:
ping [flags] <host>
EXAMPLE USAGE:
ping -c 4 google.com # Stop after sending 4 packets
COMMON PITFALL:

Running ping without pack count limit on Linux systems, which will ping infinitely until manually interrupted with Ctrl+C.

sshNetwork & Connectivity

Open a secure cryptographic network protocol for operating network services securely over an unsecured network.

SYNTAX:
ssh [flags] [user]@host
EXAMPLE USAGE:
ssh -i ~/.ssh/key.pem ubuntu@192.168.1.50
ssh -p 2222 root@example.com
COMMON PITFALL:

Leaving default port 22 exposed to the public internet without SSH key-only authentication, inviting brute force botnets.

scpNetwork & Connectivity

Securely copy files or directories between a local and remote host or between two remote hosts.

SYNTAX:
scp [flags] <source> <destination>
EXAMPLE USAGE:
scp -i key.pem ./build.zip ubuntu@192.168.1.50:/var/www/
scp -r user@remote:/var/log/nginx/ ./local_logs/
COMMON PITFALL:

Using scp recursively ('-r') for directories containing symlinks; it may result in infinite loops or duplicate copies. Use tar over ssh instead.

Archiving & Compression2 ENTRIES

tarArchiving & Compression

Archiving utility to bundle multiple files into a single archive file (often compressed).

SYNTAX:
tar [flags] <archive_name> [files_or_directories]
EXAMPLE USAGE:
tar -czvf archive.tar.gz ./folder # Compress
tar -xzvf archive.tar.gz # Decompress
COMMON PITFALL:

Forgetting to specify the '-f' (file) flag at the very end of options (e.g. doing 'tar -cfzv'), which causes tar to try to write to a file named 'z'.

zip / unzipArchiving & Compression

Package and compress or extract zip format archives.

SYNTAX:
zip -r <archive_name>.zip <folder>
unzip <archive_name>.zip -d <destination_dir>
EXAMPLE USAGE:
zip -r backup.zip ./data
unzip dist.zip -d /var/www/html/
COMMON PITFALL:

Running zip without the '-r' flag on folders, resulting in an empty zip archive that contains only the parent directory metadata.