COMMAND_LINE_INTRO(oh) LOCAL COMMAND_LINE_INTRO(oh) command_line_intro - basic commands FILES Action Command Move file or directory : mv SOURCE TARGET Copy file : cp SOURCE TARGET Copy direcotry : cp -r SOURCE TARGET Remove file : rm FILENAME Remove directory : rm -r DIRECTORY The flag -R/-r applies to different commands to execute recursive actions. FILE CONTENTS head : Get the first 10 lines of a file : head FILENAME head -15 : Get the first 15 lines of a file : head -15 FILENAME tail : Get the last 10 lines of a file : tail FILENAME tail -15 : Get the last 15 lines of a file : tail -15 FILENAME tail -f : Get the latest lines of a file continuously : tail -f FILENAME grep Get lines matching pattern : grep PATTERN FILE(S) Get lines not matching pattern : grep -v PATTERN FILE(S) Get file names not matching pattern : grep -L PATTERN FILE(S) Get line numbers matching pattern : grep -n PATTERN FILE(S) Perform a case-insensitive search for pattern : grep -i PATTERN FILE(S) Perform a recursive search : grep -R PATTERN DIRECTORY NETWORK Get network information using ifconfig (part of the package net-tools which may need to be installed) or ip. sudo ifconfig -a sudo ip add PIPES Command output can be redirected to other commands using | . xargs -n : Maximum number of arguments. -0 : User NUL as separator instead of the default space and newlines. $ echo -e "1\n2\n3" | xargs -n1 echo 1 2 3 $ echo -e "1\n2\n3" | xargs echo 1 2 3 $ echo -e "1\n2\n3" | xargs -0 echo 1 2 3 $ echo "1 2 3" | xargs echo 1 2 3 $ echo "1 2 3" | xargs -n1 echo 1 2 3 SEE ALSO text_manipulation(oh) , linux(oh) - Archlinux manpages: mv(1) , cp(1) , rm(1) , tail(1) , head(1) , ifconfig(8) , ip(8) , xargs(1) , grep(1) AUTHORS ohazot(oh) | about(oh) | ohazot.com: https://ohazot.com linux , OpenBSD 7.8 | Created:2026-03-27|Updated:2026-03-27| COMMAND_LINE_INTRO(oh)