Tag Info

New answers tagged

2

$PS2 Each time the user enters a \newline prior to completing a command line in an interactive shell, the value of this variable shall be subjected to parameter expansion and written to standard error. The default value is >. You see the > because that is the default value for $PS2 - which is the prompt string the shell will print when it cannot ...


0

Install gnu coreutils already compiled with Rudix: sudo rudix install coreutils Or download and gui install Rudix coreutils


4

The command will output the data from device /dev/null to the given file (mailbox of the root account). Since /dev/null responds just with end-of-file when reading from it nothing will be written to the file, but with the redirection > the shell will have cleared the file already. Actually this is equivalent to writing just > /var/spool/mail/root ...


1

cat /dev/null > /var/spool/mail/root truncates /var/spool/mail/root Alternative is > /var/spool/mail/root


1

tr -s '[:space:]' \\n <infile | grep '^[0-9]' ...or... sed '/^[0-9]/P;y| |\n|;D' <infile ...or probably just... sed 's/.* //' <infile ...though for the last one you might want to do s/ *$// first in case there are trailing blanks. More generally you can number a group with sed... sed 's/ *[^ ]\{1,\} *//' <infile ...written like that ...


5

To get the output you want, you could either use awk, cut or sed. The former is preferable. If your file Doc1.lst is as follow John1 0 Julien 10 Jules3 0 Julie 30 The following awk command will get the output you want. Assuming field separator is a space. awk '{print $1}' Doc1.lst Using cut cut -d' ' -f1 Doc1.lst Or using sed. Note. sed is ...


2

awk '{print $1}' Doc1.lst > Doc3.lst


2

Much of the data in a non textual file can not be represented using characters from any of the available character sets. When this data is processed by cat and shown on the screen it is displayed as ��� or other nonsensical characters as there is no other way to display them.


1

Alternatives become weird: dd if=-x 2>/dev/null


3

For commands which get input from stdin, you can use redirection: cat <-file_name


6

Use double -- to mark end of options: cat -- -<FILENAME> Other programs such as touch, rm or git checkout also follow this convention: $ touch -- -file $ ll total 0 -rw-r--r-- 1 ja ja 0 Mar 10 13:13 -file $ echo hi! >> -file $ cat -- -file hi! $ rm -- -file $ echo $? 0 WARNING: It's good practice to always use -- after rm in scripts. An ...


1

file.vdi is in all likelihood a sparse file. This is very common with virtual machine disk images: parts that have never been written to are left as holes in the file that don't consume space. You can confirm by checking whether the length of the original file matches its disk usage: ls -l file.vdi; du file.dvi I expect that ls -l will report 14GB (actual ...


3

It appears you're trying to use ttyS0 as a means to connect two processes. This won't work reliably since ttyS0 is the interface to a serial line (COM1: in Windows-speak). On the other hand, it might be that information is missing from your question. If you really do have a device on your serial port, please make that clear. What I believe you're looking ...



Top 50 recent answers are included