.Dd Created:2026-03-27|Updated:2026-03-27| .de ocsi \\$* , .. .de oxr .ocsi .Xr \\$* .. .de oit .It \\$* .. .de obdi .Bl -dash -compact .oit \\$* .. .de obdl .Bd -literal -compact \\$* .. .de onote .Bl -hang -compact .oit \\$* .El .. .de ocomm .Bl -diag -compact .oit \\$* .El .. .de opsy .Pp .Sy - \\$* .. .de obc .Bl -column \\$* .. .de obc2 .obc opt desc .. .de obc3 .obc option arguments description .. .de am .opsy Archlinux manpages: \\$* .. .de om .opsy OpenBSD manpages: \\$* .. .Dt COMMAND_LINE_INTRO oh .Os linux , OpenBSD 7.8 | .Nm command_line_intro .Nd basic commands .Sh FILES .obc2 .It Sy Action Ta Sy Command .It Move file or directory Ta : Li mv SOURCE TARGET .It Copy file Ta : Li cp SOURCE TARGET .It Copy direcotry Ta : Li cp -r SOURCE TARGET .It Remove file Ta : Li rm FILENAME .It Remove directory Ta : Li rm -r DIRECTORY .El The flag -R/-r applies to different commands to execute recursive actions. .Sh FILE CONTENTS .obc3 .It head Ta : Get the first 10 lines of a file Ta : Li head FILENAME .It head -15 Ta : Get the first 15 lines of a file Ta : Li head -15 FILENAME .It tail Ta : Get the last 10 lines of a file Ta : Li tail FILENAME .It tail -15 Ta : Get the last 15 lines of a file Ta : Li tail -15 FILENAME .It tail -f Ta : Get the latest lines of a file continuously Ta : Li tail -f FILENAME .El .Ss grep .obc2 .It Get lines matching pattern Ta : Li grep PATTERN FILE(S) .It Get lines not matching pattern Ta : Li grep -v PATTERN FILE(S) .It Get file names not matching pattern Ta : Li grep -L PATTERN FILE(S) .It Get line numbers matching pattern Ta : Li grep -n PATTERN FILE(S) .It Perform a case-insensitive search for pattern Ta : Li grep -i PATTERN FILE(S) .It Perform a recursive search Ta : Li grep -R PATTERN DIRECTORY .Sh NETWORK Get network information using ifconfig (part of the package net-tools which may need to be installed) or ip. .Dl sudo ifconfig -a .Dl sudo ip add .Sh PIPES Command output can be redirected to other commands using | . .Ss xargs .obc2 .It -n Ta : Maximum number of arguments. .It -0 Ta : User NUL as separator instead of the default space and newlines. .El .obdl $ echo -e \&"1\en2\en3\&" | xargs -n1 echo 1 2 3 $ echo -e "1\en2\en3" | xargs echo 1 2 3 $ echo -e "1\en2\en3" | 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 .Ed .Sh SEE ALSO .oxr text_manipulation oh .Xr linux oh .am .oxr mv 1 .oxr cp 1 .oxr rm 1 .oxr tail 1 .oxr head 1 .oxr ifconfig 8 .oxr ip 8 .oxr xargs 1 .Xr grep 1 .Sh AUTHORS .An -nosplit .Xr ohazot oh | .Xr about oh | .Lk https://ohazot.com ohazot.com .Aq Mt admin@ohazot.com