How to save the output of ls command?
Answer:
You might have tried the following
# ls > output.txt
But the format in output.txt is not the same as you executed the ls command.
Use the -C flag
# ls -C > output.txt
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to save the output of ls command?
Answer:
You might have tried the following
# ls > output.txt
But the format in output.txt is not the same as you executed the ls command.
Use the -C flag
# ls -C > output.txt
How to view output in Hex
Answer:
Use the hexdump command,
# hexdump test.txt
0000000 6261 0a63
0000004
To display hex+ASCII (Canonical) altogether
# hexdump -C test.txt
00000000 61 62 63 0a |abc.|
00000004
How to send message to a syslog
Answer:
Basically you need to use the logger command, e.g.
logger "have fun with logger"
You will find the log went to /var/log/messages
Jan 15 23:08:34 www john: have fun with logger
Convert UTF-16 encoded file to UTF-8
Answer:
iconv is what you need and is available on most Linux platforms.
# iconv -f UTF-16 -t UTF-8 text.txt
Display a calendar in Linux
Answer:
Try the cal command.
# cal
January 2010
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31