A UNIX Command $bsd-write jeffrin 8 bsd-write: jeffrin is not logged in on 8 $bsd-write jeffrin tty8 bsd-write: jeffrin has messages disabled on tty8 $mesg y $bsd-write jeffrin tty8 bsd-write: jeffrin has messages disabled on tty8 $w 20:08:58 up 23 min, 3 users, load average: 0.02, 0.15, 0.16 USER TTY FROM LOGIN@ IDLE JCPU PCPU …
Tag Archives: unix
truncate – shrink or extend the size of a file to the specified size
A UNIX Command $cat example.text hello $ls -l example.text -rw-r–r– 1 jeffrin jeffrin 6 Jun 21 02:32 example.text $truncate -s 10 example.text $ls -l example.text -rw-r–r– 1 jeffrin jeffrin 10 Jun 21 02:35 example.text $hexdump example.text 0000000 6568 6c6c 0a6f 0000 0000 000000a $cat example.text hello $truncate -s 9 example.text $ls -l example.text -rw-r–r– 1 …
Continue reading “truncate – shrink or extend the size of a file to the specified size”
mkfifo command.
$ls -l jeffrin ls: cannot access jeffrin: No such file or directory $mkfifo jeffrin $ls -l jeffrin prw-r–r– 1 jeffrin jeffrin 0 Oct 12 00:02 jeffrin $ $ls -d > jeffrin “another terminal” $cat < jeffrin . $ A “FIFO” is a special file type that permits independent processes to communicate. One process opens the …
gcov code coverage
$vi hey.c $gcc -fprofile-arcs -ftest-coverage hey.c $./a.out Hey 🙂 $gcov hey.c File ‘hey.c’ Lines executed:100.00% of 3 hey.c:creating ‘hey.c.gcov’ $cat hey.c.gcov -: 0:Source:hey.c -: 0:Graph:hey.gcno -: 0:Data:hey.gcda -: 0:Runs:1 -: 0:Programs:1 -: 1:#include 1: 2:main() -: 3:{ 1: 4:printf(” Hey 🙂 \n”); 1: 5:} $ The “.gcov” files can be examined using a normal editor. …
chmod – change file mode bits
ABOUT chmod In Unix and Unix-like operating systems, chmod is the command and system call which is used to change the access permissions of file system objects (files and directories). It is also used to change special mode flags. The request is filtered by the umask. The name is an abbreviation of change mode.[1] TYPICAL …