Working with Files
cp, mv, rm, mkdir, find
Creating, copying, moving, and deleting files and directories is daily work. The commands are short and consistent.
mkdir runs # make a directory
mkdir -p a/b/c # make nested directories in one go
cp config.json config.bak # copy a file
cp -r src src_backup # copy a directory and its contents (-r)
mv old.v new.v # rename or move a file
rm temp.log # delete a file
rm -r old_run # delete a directory and everything in itFinding files
On a real project you will lose track of files constantly. find searches a directory tree by name or other criteria.
find . -name "*.rpt" # all .rpt files below here
find . -name "spm*.v" # files starting with spm, ending .v
find runs -name "*.log" -mtime -1 # .log files changed in last daythere is no recycle bin. rm deletes permanently and rm -r deletes whole trees with no undo. Double-check the path before you press Enter, and never run rm -rf on a path you are not certain of. This is the most dangerous command in this path.
get into the habit of ls before rm: list what matches first, confirm it is what you mean, then delete. A careful engineer checks before destroying.
Finished reading?
Mark it complete to track your progress through the path.
Go further
Use these Linux skills on a real flow: set up OpenLane and take a RISC-V CPU all the way to GDSII.
Includes Interview Bootcamp and Fresher Pack free, worth ₹498.
Get new lessons by email
New lessons, interview prep and real EDA tool workflows. No spam.