Shell

The term 'shell' refers to a general class of text-based interactive command interpreters most often associated with the Unix & Linux operating systems. For questions about shell scripting, please use a more specific tag such as 'bash', 'powershell' or 'ksh'. Without a specific tag, a portable (POSIX-compliant) solution should be assumed, though using 'posix' in addition or 'sh' instead is preferable.

52 votes
12 answers
1.3K views
How do I copy a folder from remote to local using scp?

How do I copy a folder from remote to local host using scp? I use ssh to log in my server. Then, I would like

avatar
Scot
0 1 0 9
asked 07 September, 2021
51 votes
26 answers
2K views
How to check if a string contains a substring in Bash

I have a string in Bash: string="My string" How can I test if it contains another string? if [ $string ?? &ap

avatar
Sena
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
1.5K views
How to concatenate string variables in Bash

In PHP, strings are concatenated together as follows: $foo = "Hello"; $foo .= " World"; Here, $foo becomes

avatar
Luis
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.6K views
How can I check if a directory exists in a Bash shell script?

What command can be used to check if a directory exists or not, within a Bash shell script?

avatar
Louetta
0 1 0 9
asked 07 September, 2021