Engineering Tools for AI

प्रोग्रामिंग

मुख्य terminal commands

Web project edit, run, test और debug करते समय उपयोग होने वाले terminal commands की searchable guide।

33 commands

नेविगेशन

print working directory

pwd

pwd

अर्थ

Prints the absolute path of the folder where the terminal is currently working.

कब उपयोग करें

Run it before commands that depend on being inside the project folder.

उदाहरण

pwd

अनुरोध उदाहरण

Check which folder the terminal is currently in.

नेविगेशन

list files

ls

ls

अर्थ

Lists files and folders in the current directory.

कब उपयोग करें

Use it to confirm expected files such as package.json, src, or next.config.mjs are present.

उदाहरण

ls

अनुरोध उदाहरण

List the files in the current project folder.

नेविगेशन

change directory

cd

cd ~/projects/my-web-app

अर्थ

Moves the terminal to another folder.

कब उपयोग करें

Use it before running project-specific commands such as npm run build.

सावधानी

A command can fail if you are in the wrong folder, even when the command itself is correct.

उदाहरण

cd ~/projects/my-web-app

अनुरोध उदाहरण

Move to the project folder before running commands.

नेविगेशन

clear screen

clear

clear

अर्थ

Clears visible terminal output without changing files or command history.

कब उपयोग करें

Use it before rerunning a command when the old output is visually noisy.

उदाहरण

clear

अनुरोध उदाहरण

Clear the terminal before rerunning the build.

फ़ाइल और फ़ोल्डर

show file contents

cat

cat package.json

अर्थ

Prints the contents of a file to the terminal.

कब उपयोग करें

Use it for short files such as package.json, config files, or small text files.

सावधानी

For very large files, prefer sed, rg, or a pager instead of printing everything.

उदाहरण

cat package.json

अनुरोध उदाहरण

Show the package.json scripts.

फ़ाइल और फ़ोल्डर

show selected lines

sed

sed -n '1,120p' src/components/SiteHeader.tsx

अर्थ

Can print a selected range of lines from a file.

कब उपयोग करें

Use it to inspect one section of a source file without opening the whole file.

उदाहरण

sed -n '1,120p' src/components/SiteHeader.tsx

अनुरोध उदाहरण

Show the first 120 lines of SiteHeader.tsx.

फ़ाइल और फ़ोल्डर

make directory

mkdir

mkdir -p src/app/[locale]/reference/terminal-commands

अर्थ

Creates a new folder. The -p option also creates missing parent folders and avoids failing if the folder already exists.

कब उपयोग करें

Use it before adding a new page folder or asset folder.

उदाहरण

mkdir -p src/app/[locale]/reference/terminal-commands

अनुरोध उदाहरण

Create the route folder for the terminal commands page.

फ़ाइल और फ़ोल्डर

copy files

cp

cp .env.example .env.local

अर्थ

Copies a file or folder to another location.

कब उपयोग करें

Use it to create local config from an example file or duplicate a template.

सावधानी

If the destination file exists, cp can overwrite it.

उदाहरण

cp .env.example .env.local

अनुरोध उदाहरण

Copy the example env file only if it will not overwrite local settings.

फ़ाइल और फ़ोल्डर

move or rename

mv

mv old-name.ts new-name.ts

अर्थ

Moves a file or folder, or renames it when the destination is in the same folder.

कब उपयोग करें

Use it when changing a filename, route folder name, or moving assets.

सावधानी

Renaming route folders changes URLs.

उदाहरण

mv old-name.ts new-name.ts

अनुरोध उदाहरण

Rename this file and update imports if needed.

सुरक्षा

remove files

rm

rm unused-file.ts

अर्थ

Deletes files. With -r it can delete folders recursively.

कब उपयोग करें

Use it only when a file is intentionally removed from the project.

सावधानी

rm is destructive. Check the path carefully before running it.

उदाहरण

rm unused-file.ts

अनुरोध उदाहरण

Before deleting this file, explain what will be removed.

खोज और जाँच

ripgrep search

rg

rg -n "errorMessageGuide" src

अर्थ

Searches text quickly across files.

कब उपयोग करें

Use it to find imports, components, slugs, CSS classes, or old names before editing.

उदाहरण

rg -n "errorMessageGuide" src

अनुरोध उदाहरण

Search where this component is imported.

खोज और जाँच

list tracked-looking files fast

rg --files

rg --files src/app

अर्थ

Lists file paths quickly, respecting common ignore rules.

कब उपयोग करें

Use it to find page files, components, and libraries without scanning build output.

उदाहरण

rg --files src/app

अनुरोध उदाहरण

List reference page files under src/app.

खोज और जाँच

find paths

find

find src -name 'page.tsx'

अर्थ

Searches the filesystem by path, name, or other file properties.

कब उपयोग करें

Use it when searching by filename pattern rather than text content.

उदाहरण

find src -name 'page.tsx'

अनुरोध उदाहरण

Find every page.tsx route file.

खोज और जाँच

count lines or words

wc

wc -l src/lib/terminal-commands.ts

अर्थ

Counts lines, words, or bytes.

कब उपयोग करें

Use it to estimate file size or count search results when combined with other commands.

उदाहरण

wc -l src/lib/terminal-commands.ts

अनुरोध उदाहरण

Count how many lines are in this data file.

पैकेज

install dependencies

npm install

npm install

अर्थ

Installs packages listed in package.json and package-lock.json.

कब उपयोग करें

Use it after cloning a project or when dependencies are missing.

सावधानी

It can change package-lock.json if dependency versions resolve differently.

उदाहरण

npm install

अनुरोध उदाहरण

Install dependencies only if node_modules is missing.

Dev server

start dev server

npm run dev

npm run dev

अर्थ

Runs the project's local development server script.

कब उपयोग करें

Use it to test pages in the browser while editing.

सावधानी

A running dev server keeps the terminal session busy until stopped.

उदाहरण

npm run dev

अनुरोध उदाहरण

Start the dev server and tell me the local URL.

पैकेज

production build

npm run build

npm run build

अर्थ

Runs the production build script and catches many compile, route, and type problems.

कब उपयोग करें

Run it before deployment or after adding new pages.

उदाहरण

npm run build

अनुरोध उदाहरण

Run the production build and summarize warnings or failures.

पैकेज

lint check

npm run lint

npm run lint

अर्थ

Runs the project's lint script to catch style and static code issues.

कब उपयोग करें

Run it before build when you want quick feedback.

उदाहरण

npm run lint

अनुरोध उदाहरण

Run lint and show only actionable errors.

पैकेज

check Node version

node -v

node -v

अर्थ

Prints the installed Node.js version.

कब उपयोग करें

Use it when a project or dependency requires a specific Node version.

उदाहरण

node -v

अनुरोध उदाहरण

Check the Node.js version before explaining this warning.

पैकेज

run package command

npx

npx next info

अर्थ

Runs a command from an installed or temporarily downloaded npm package.

कब उपयोग करें

Use it for one-off tooling commands when no package script exists.

सावधानी

npx can download packages from the network if they are not installed.

उदाहरण

npx next info

अनुरोध उदाहरण

Explain whether this npx command needs network access.

Git

check Git status

git status

git status --short

अर्थ

Shows the current branch and changed, staged, or untracked files.

कब उपयोग करें

Run it before edits, commits, pulls, or branch switches.

उदाहरण

git status --short

अनुरोध उदाहरण

Check Git status and summarize the changed files.

Git

show code differences

git diff

git diff -- src/components/SiteHeader.tsx

अर्थ

Shows line-by-line differences in changed files.

कब उपयोग करें

Use it to review exactly what changed before committing.

उदाहरण

git diff -- src/components/SiteHeader.tsx

अनुरोध उदाहरण

Review the diff for this task.

Git

view commit history

git log

git log --oneline -5

अर्थ

Shows commit history.

कब उपयोग करें

Use it to see recent work or find a commit to inspect.

उदाहरण

git log --oneline -5

अनुरोध उदाहरण

Show the five most recent commits.

Git

stage changes

git add

git add src/lib/terminal-commands.ts

अर्थ

Selects changes to include in the next commit.

कब उपयोग करें

Use explicit paths for focused commits.

उदाहरण

git add src/lib/terminal-commands.ts

अनुरोध उदाहरण

Stage only files related to this terminal commands page.

Git

save commit

git commit

git commit -m "Add terminal command reference"

अर्थ

Records staged changes into Git history.

कब उपयोग करें

Use it after reviewing the staged changes.

उदाहरण

git commit -m "Add terminal command reference"

अनुरोध उदाहरण

Commit the staged changes with a clear message.

Dev server

stop running command

Ctrl+C

Press Ctrl+C in the dev server terminal

अर्थ

Interrupts the currently running terminal command.

कब उपयोग करें

Use it to stop a local dev server before closing the terminal or changing ports.

सावधानी

Use it in the terminal session where the command is running.

उदाहरण

Press Ctrl+C in the dev server terminal

अनुरोध उदाहरण

Stop the running dev server.

Dev server

list open files and ports

lsof

lsof -i :3001

अर्थ

Can show which process is using a port.

कब उपयोग करें

Use it when a dev server fails with EADDRINUSE.

उदाहरण

lsof -i :3001

अनुरोध उदाहरण

Find which process is using port 3001.

Dev server

list processes

ps

ps aux

अर्थ

Shows running processes.

कब उपयोग करें

Use it to inspect running development tools, servers, or background processes.

उदाहरण

ps aux

अनुरोध उदाहरण

Check whether a Next.js dev server is still running.

सुरक्षा

stop process by PID

kill

kill 12345

अर्थ

Sends a signal to stop a process by process ID.

कब उपयोग करें

Use it when a server keeps running after normal interruption is not available.

सावधानी

Check the PID carefully so you do not stop the wrong process.

उदाहरण

kill 12345

अनुरोध उदाहरण

Before killing a process, show me what the PID belongs to.

नेटवर्क

make HTTP request

curl

curl -I http://localhost:3001/ko

अर्थ

Sends HTTP requests from the terminal and prints the response.

कब उपयोग करें

Use it to check whether a local or deployed URL returns 200, 404, 500, or redirects.

उदाहरण

curl -I http://localhost:3001/ko

अनुरोध उदाहरण

Use curl to check whether this page returns 200.

नेटवर्क

check network reachability

ping

ping 172.30.1.55

अर्थ

Checks whether a host responds to basic network packets.

कब उपयोग करें

Use it as a rough network reachability check, not as a web app health check.

उदाहरण

ping 172.30.1.55

अनुरोध उदाहरण

Check whether this device can reach the dev machine IP.

खोज और जाँच

locate command executable

which

which node

अर्थ

Shows which executable file will run for a command name.

कब उपयोग करें

Use it when different Node, npm, or tool versions may exist on the machine.

उदाहरण

which node

अनुरोध उदाहरण

Check which node executable is being used.

सुरक्षा

change file permissions

chmod

chmod +x script.sh

अर्थ

Changes read, write, or execute permissions on files.

कब उपयोग करें

Use it when a local script should be executable.

सावधानी

Avoid broad permission changes such as chmod -R 777.

उदाहरण

chmod +x script.sh

अनुरोध उदाहरण

Explain the safest permission change for this script.