0
votes
1answer
10 views

sending argument to vim using grep

I saw this question but I couldn't implement what I'm looking for.Here is what I want:I have a file with a few lines ending with 4.1.01.97 (same number for all lines - but number can change from ...
20
votes
4answers
10k views

What is the default password of screen?

When I type Ctrl-X X (sic) in screen, the session is locked. What is the default password? Is it the same password which I use to log in to linux?I ask because: I connect to several different remote ...
0
votes
1answer
14 views

how to echo text into a file from the CLI to ammend a variable in the file?

using Centos7e.gvi test.txt test.txt contains the following informationx=100y=200z=300I want to put a command into the CLI such as echo x=250 >> test.txt but instead of x=250 being ...
1
vote
1answer
28 views

bash + how to avoid specific messages in the log file

when I run the bash script on my Linux machine we get the following errors in my log , note - we set in the script:exec > $log 2>&1 , ( in order to send all standard error/output to $...
18
votes
2answers
23k views

How to prevent SSH from disconnecting if it's been idle for a while

I have a ssh connection to a machine which gets disconnected by that machine after 30 minutes of no user input. However, if I start something like top, the connection stays alive.Since this is a ...
0
votes
1answer
16 views

How to install package from a .tar.lz file

I'm using bash (Cygwin, specifically). I'm trying to install GNU dd_rescue, which comes in a .tar.lz archive file.When I use:tar -xzf ddrescue-1.22.tar.lz...it returns with the following error:...
0
votes
1answer
47 views

mv within shell script does not move files

Often discussed, yet the answers did not get me to a solution unfortunately, and I am a bit ashamed that I need to ask this question again. But, here we are.I have a shell script dosomething.sh with ...
1
vote
0answers
7 views

extend gnome-shell PATH for access to ruby binary with RVM

I have a terminal written in ruby that I install with a gem. I want to be able to launch this terminal when I hit Alt+F2 in gnome-shell. When I used the ruby version of my system, I just have to ...
3
votes
6answers
739 views

Pre-authorise sudo? (So it can be run later)

I often set my work computer running some time-consuming computations before I go home in the evening. After they're done, I'd like it to shutdown. However, as shutdown requires root privileges, it ...
0
votes
0answers
8 views

Linux Shell Script to rename a specfic file's extension to .bak in the DST_DIR and copy new file to it from a SRC_DIR [on hold]

I'm getting frustrated trying to figure this out since i'm still a noob at it and under a real time crunch. I'm asking for anyone to help me write a simple .sh script. If I can get this done it will ...
0
votes
3answers
48 views

How do I make a command to refresh itself without writing a .sh script?

I'm doing that command to measure RAM usage:while sleep 1; do free && echo -e && ps -eo rss | awk '{sum+=$1} END {print sum}' && echo -e "\n"; doneHowever, it still keeps ...
31
votes
5answers
32k views

How do I change the default startup directory in Cygwin?

Whenever I start cygwin, I need to cd several levelsdown to the only directory that I care about when using cygwin. How can I get cygwin to start in this particular directory bydefault...i.e., ...
3
votes
2answers
56 views

Achieve better compression for multiple gzipped files

I have several directories containing thousands of gzip files (overall we are talking about 1M files). Some of these files are corrupted and most of them are really small in size (a couple of KB)....
3
votes
1answer
147 views

How can I run dd as fast as possible?

I'm learning bash, and what with all the confusion around the many, many different ways there are to zero-write a drive or transfer data from/to one (shred vs dd vs pv vs cat vs tee and so on), I'm ...
1
vote
2answers
44 views

$SHLVL does not increase in ( echo $SHLVL)

I am learning shell scripts and stuck at this little experimental shell scripts:1 #!/usr/bin/env bash2 A=13 (A=2;echo "A is $A in $SHLVL")4 echo "A is $A in $SHLVL"5 exit 0Without doubt, $A in ...

153050per page