Please do not edit above this
Test how to use this hedgedoc live document, this is how we ask questions and get help.
This is a question, or is it?
This is another question, or maybe not?
…
…
test it.
… write something…
just testing…
Hi,everyone, do anyone know how to d
My advisor came to our offices and asked each person to do several parameters of a simulation and email the results back.
Good afternoon. How will we be able to get access to the recordings of these trainings?
Hello, How are we supposed to open a terminal window as a windows user without an aalto acount?
https://aaltoscicomp.github.io/linux-shell/the-shell/
echo 'hello $HERE' there $HERE
and see what happens with the two $HEREhttps://aaltoscicomp.github.io/linux-shell/starting-commands/
Why does some folders have '.' as the first character?
ls
command).Pasting into the terminal adds random symbols, what's the best way to paste?
What is the difference between ls and dir?.
ls
is the stanard linux one, dir
is an alias with some default options.What is the difference between the terms: unix and linux, if any?
Comment: sometimes command --help
is a good alternative (e.g. if man
is not installed) but it depends on the command +1
The 'pwd' command outputs 'u/11/user/unix', what does the 11 represent?
NN
is basically random and used to divide home directories up to different storage systemsid
), not that it matters anyhow.Is it possible to use emacs while working on Triton? I meant graphically
Anyone have a recommendation for a good shell cheatsheet? (optimized for scientist and researcher type people?)
how to 'unclick' in presemo?
I have a silly question, what exactly ssh is ? I heared about the the putty how it is different from ssh
ssh
is a program to connect to other computers: it only gives the shell, so it's small, efficient, and secure. It basically makes one terminal connect to another computer. It's really one of the things that makes all infrasturture in the world work! (ssh lets a lot of other stuff work too, like network connections and file access.)Why there is #!/bin/bash
in the first line
#!/usr/bin/python
and write the script in Python.#!
actually tells the operating system "use this program to run this script" (run PROGRAM SCRIPT_NAME
). So it's not bash running python, but the operating system directly going to Python (or bash, or whatever).What is the difference between making a script executable with chmod +x <file_name> and inputting command bash <file_name>? I've always been running scripts with bash <file_name> and never used chmod +x …
#!program_name
is the technical equivalent of program_name script_file_name
! Choose whichever makes sense. I usually use program_name script_file_name
.Why is Ivan able to run 'help.sh' without using 'bash help.sh' or 'sh help.sh'?
chmod a+x help.sh
which makes it executable. Second, .
(the current directory) may be in the PATH
environment variable which tells where to look for programs to run (so that help.sh
would find help.sh
in the current directory). We should ask when Ivan comes back this is a good qustion!How can %CPU exceed 100%?
can any body shre the link to the question?
I lost it
–-Could you please tell me again how to swtich between the screen, I did not get it?
https://presemo.aalto.fi/shell
Could you please go quickly over the correct options?
FALSE BASH can only execute built-in commands
TRUE BASH, as any shell, combines other programs to make it to work together
TRUE BASH documentation can be found on the web
TRUE man pages is the way to get info about commands
FALSE man pages available for the external programs only, for the built-in one has to use 'help'
FALSE type -a' tells about file content's type
TRUE BASH is also a scripting language
Thanks a lot
Friendly reminder: next course in 3 weeks -> https://coderefinery.org/
https://aaltoscicomp.github.io/linux-shell/processes/
top
on Mac looks a little bit different than standard Linux. Windows implementations (like gitbash) do not usually have a top
command.
Is there a way to be sure we are not creating a big mess while killing a process?
kill -9
and see if that works. You could try the parent. Sometimes stuff can get really stuck at a low level, and nothing works. Let's just hope you don't get here!, but usually I'll ignore it, make new shell and wait for reboot.https://presemo.aalto.fi/shell
It is not important, but I am just curious. Who can kill zombie processes?
I reset my shell, and still have a background job called '[1]+ Stopped grep –color=auto clear' Why's that?
reset
?What's the meaning of the + and - next to number?
+
means default for fg
command. -
means next-up for +
if the +
job ends.WHats the difference between killing via process id or via jobs?
jobs
only shows jobs which this one very shell knows about and has a different id for convenient use in that shell. kill
is generic.How to kill screens?
screen -ls
: list screensscreen -r [name]
reattacheC-a C-d
: detach screen (control-a, etc)screen -XS <screen.ID> quit
to kill a screen from outsideHow to avoid 'screen within a screen'? E.g. use 'screen' in a shell on my local computer, then 'ssh user@triton.fi', then 'screen' again on triton? is it meant to be used like this?
Exercise: https://aaltoscicomp.github.io/linux-shell/processes/#exercises-1-1
Mark your exercise progress at: https://presemo.aalto.fi/shell
What does "which" shell mean? :D
bash
, zsh
, (probably one of these), tcsh
, csh
.echo $SHELL
Will there be answers for this excersise in the end?
What's a hot key?
Will the material be available for participants after the course if at some point need some "memory refreshment"?
Why did I get the error "no matching criteria specified" when using pgrep -l?
Can I use search command in man?
I am using the VMware remote server from a Mac. When I am using nano, I cannot sent the process into the backgroun with "bg". It will write the g into the file. Is there a different combination of kezs for Mac?
Where the recording of the lecture will be available after the course?
.What does | do?
ls | grep a
lists all the files with ls
and passes the output to command grep
to filter only those with the letter a
in it..
How can we find the pid of a backgroup process?
jobs -l
)Please check presemo for quick survey (21 fine, 9 too fast/complex). If you have more detailed comments on what to improve, please write them here. Write also what went well. :)
https://aaltoscicomp.github.io/linux-shell/files-and-directories/
could you show example cases with each of them? Okay thanks! +1
How can I open the window with my cmd history in the same way as you did?
Are there wildcards to discriminate capital and lower characters?
ls [a-z]*
vs ls [A-Z]*
. But that's really just giving some limit and may not be useful for what you need…just a comment that I find using eg. FileZilla handy when playing with files and directories
Once again, what was rm file 1?.txt supposed to do?
rm
deletes files… 1?.txt
expands to "anything with 1 and .txt with one character in the middle". So the shell finds all files that match, passes the names to rm
, and rm
removes themif you are not sure: before deleting many files at once I like to run "rm -i 1?.txt" which means "interactive" that will ask me "are you sure you want to delete file 1a.txt?" etc for each file
If you get du: .[!.]*: No such file or directory
it means that you do not have any hidden file in the folder where you are running the command du -sh * .[!.]*
What are lrwx and drwx?
would it nice to make the session slightly slower +1
If you are a mac user, when you run ls -l
you might get some files with permissions -r--r--r@
the @
is "extended attributes", extra metadata that mac uses for the file
the 4,2,1 (r,w,x) come from the binary 100 010 001, so the binary 111 has the switch on for r w x i.e. the decimal 7
-v
stands for what?
man chmod
then inside man type /-v
and it searches within the man page the meaning of the option -v
-v
often makes output of unix commands more verbose, so if a command fails, it often helps to check the verbose outputwhat tryton means here???
is it possible to get the this recording to watch again???
/usr/bin/[
is an actual bash built-in for testing. It is the equivalent of command "test". It tests for a statement if it true or false.https://aaltoscicomp.github.io/linux-shell/find/
find
with the option -exec
which means "for each file you find, execute this command".
find . -type f -exec touch {} \; -print
If you have any comments regarding today just let us know here below (what can be improved and also what went well)
One serious problem is that the university of Helsinki server Cubbli Linux does not let me type special characters in terminal. Thus, doing the exercises in real-time is a problem. Another limitation is the notebook screen size, with three windows open legibility becomes a problem for the terminal and demospace windows. Just FYI …, not that I believe you guys can do much about these unfortunate limitations, but it may be good to know about these limitations anyway.
https://aaltoscicomp.github.io/linux-shell/file-archive-transfer/
gzip filename.extension
and you will get a file called filename.extension.gz
https://aaltoscicomp.github.io/linux-shell/file-archive-transfer/#exercise-1-3
. How can I search for a word in a man page?
I am getting 'file is the archive' error when tar. What am I doing wrong?
What is the command you are typing?
here the correct sequence:
tar -caf arhive_name.tar.gz directory_to_be_archived/
So first you specify where the archive goes and then the files you want to archive. See beginning of page https://aaltoscicomp.github.io/linux-shell/file-archive-transfer/#file-archiving
Does "find -type f -perm /666" do the same thing?
Extract only one particular file to a subdirectory from the archive
https://aaltoscicomp.github.io/linux-shell/cli_utiltities/
https://aaltoscicomp.github.io/linux-shell/pipelines-grep/
Thank you for joining us! Leave some feedback on the course :)
Anything that comes to your mind: things to improve, things who worked well, future ideas, suggestions…
Finally, join us for CodeRefinery workshop in about 3 weeks to learn about git version control + reproducible science + good coding practice + research software… https://coderefinery.org/
And Enrico will email you about videos when they are uploaded + future courses to continue your learning path.
Please always write new questions at the end of the document, above this line.