DEV Community

Philip
Philip

Posted on

Useful Command line commands

pwd show directory

ls show all files in directory

ls -all info about files

ls -a shows hidden files

clear clears screen

cd change directory / redirects to home

cd .. go backwards

cd - goes to prev directory

mkdir new-folder make a directory

touch new-file.txt make a new file

cp new-file.txt new/folder/new-file-copy.txt make a copy

mv new-file-copy.txt ../new-file-copy.txt moves a file

mv file.txt file-2.txt rename a file

up/down arrow keystoggle prev next commands

rm new-file-copy.txt removes a FILE

rm -r new-folder deletes all files and folder

cat file-name.txt view whats in a file/s

cat file1.txt file2.txt > file3.txt concatenates two files

> pipes content into a file or over rides

echo Hi prints HI

echo Hi >> file3.txt HI gets added to end of the file content

man provides documentation eg man ls

nano manage file content / file editor

ctrl + c exits process

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay