All Questions
50
questions
-2
votes
1
answer
54
views
Atime don't change on mounted drive
i have CentOS Stream 9.
when i mount a usb drive and create a file using touch command the Access time in stat command don't change and stays:
"Access: 2023-06-20 03:00:00.000000000 +0300"
...
2
votes
0
answers
44
views
Cat with gun parallel does not continue as expected
Here is my code.
file_name="all_parts"
find parts/ -type f > ${file_name}
while read part
do
echo processing ${part}
cat ${part} | parallel -j 100 'wget {} -o logs/...
2
votes
1
answer
1k
views
concatening a variable to a file using cat
I wanted to do a bash function that given a text variable, it would concatenate it to a file. i.e
function print() {
cat << 'EOF' >> file
This $1 is a variable
EOF
}
But it wouldnt work. ...
0
votes
3
answers
2k
views
perform cat via ssh, send text or file via ssh
Greetings I am making a script to automate the sending of public keys but I cannot send my file or variable through ssh either by "echo or cat"
6
votes
1
answer
3k
views
Cat hangs when attempting to read empty STDIN
My script attempts to gather information that may or may not be present in STDIN at execution time, but cat hangs if the pipe is empty. How can I ensure that my script skips this step if this there is ...
19
votes
7
answers
55k
views
Cat command and echo
I'd like to concatenate the output from echo with content of a file. I've tried the following comand:
echo "abc" | cat 1.txt > 2.txt
but the 2.txt file only contains the content from 1.txt. Why ...
1
vote
2
answers
6k
views
select columns on cat command
I use a file as a little db table. The content is like this:
client1 john doe engineer cal
client2 jane doe nurse ny
client3 ali veli doctor ny
I want to find ...
1
vote
1
answer
16k
views
cat command with a variable that has spaces
I need to use cat command to display the contents of a file, and the filename has spaces in them: "embedded board link.rtf".
I assign the filename using a variable: I="embedded board link.rtf", but ...
7
votes
7
answers
10k
views
What is the equivalent of Bash's cat -n in PowerShell?
I want to cat a file and output the line number of each line it outputs.
However, in PowerShell, cat outputs an array. Hence the question effectively becomes: How do I print the index of each item ...
1
vote
1
answer
597
views
echo stdin, unless empty, in which case cat a file
The pipeline fstdraw in.fst | dot -Tpng | convert - -rotate 90 out.png converts a file in a certain binary format into a PNG image.
Unfortunately, in some cases fstdraw emits zero bytes. (A bug in ...
0
votes
1
answer
175
views
Adding Tag Data to File
For a security product (data loss prevention) my group is trying to tag files with specific keywords to allow for HR/Legal to specifically flag files for tracking by our DLP software. Currently the ...
4
votes
2
answers
11k
views
Piping commands into nc
I've seemingly searched many very similar questions but never quite found something to work. I'm trying to use a raspberry pi (2nd gen) to communicate with a Wifi OBDII sensor. I'm able to use the ...
0
votes
1
answer
1k
views
Tar & save the output of a command
I want to tar the output of a command, say cat hello.world, to a compressed tar file.
I don’t want to save a temporary file and later tar it manually.
How can I do this?
0
votes
2
answers
2k
views
Recover text file that I deleted with "cat" command
I used
cat > filename
while not thinking about it, then hit
ctrl + c and naturally enough the file is now empty... Is there a way to recover that file's contents?
2
votes
1
answer
17k
views
Receiving data from Serial Port
I want to receive data from RS232 Serial port to my terminal and with a directive to a file. It should be pretty straight forward.
cat /dev/ttyS0
cat /dev/ttyS0 > file.txt
Before that I've ...