LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-03-2018, 06:13 PM   #1
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Rep: Reputation: 1
recommend easy tasks after learning basic command line


If this is in the wrong forum please advise and I will change it.

I am just learning some of the basic Command Line instructions cd, ls etc. I was wondering if there any exercise that exist where one can link a few of these instructions together to do work on my own PC or to achieve some task - preferably progressing at a steady pace. I think I learn quicker if there is some outcome rather than just entering cd and seeing the directory change. I hope people know what I am trying to achieve - I couldn't find much on a quick search.
 
Old 11-03-2018, 06:53 PM   #2
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Hello:

Let me offer the Debian Administrator's handbook as a Use-it-when-ya-think-of-it method to acquire more experience.
You can even install it.
I have, (as do quite a few of us here) collections of such resources) It all depends on the task.
If the task is to learn, well there's no end.
What did you have in mind?

Practical exercises are difficult to suppose or assume anymore, so I'm asking.?

https://debian-handbook.info
https://cmdchallenge.com
When I was just learning, I lived at CommandLineFu
I wrote shell scripts to "help maintain" the system.
First and foremost, I learned "the shell", bash specifically.
Comfortable with breaking and fixing your own gear, if necessary?

My blog post is littered with such references. Start at "### Beginner User Guides: ###" and the next 2 sections.

Have fun.
John out.

Last edited by Habitual; 11-03-2018 at 06:56 PM.
 
Old 11-03-2018, 06:55 PM   #3
Mike25
Member
 
Registered: Feb 2003
Location: ON, Canada
Distribution: Fedora & RH3
Posts: 56
Blog Entries: 2

Rep: Reputation: 11
How about this one?
http://linuxcommand.org/
 
Old 11-03-2018, 07:06 PM   #4
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
In my view the bash shell is good for when you know precisely what you want to do, and when it's something repetitive (so you write a one-liner or a more complex script to automate it). So if you can think of anything like that, that's a good start.

File management is one good use. Copying, renaming, making folders, unzipping, etc. It becomes easy and routine in bash with a bit of practice.

To get into some more advanced bash features, simple image processing is a good use. One time I had a folder about a hundred large print-resolution stock images and needed to scale them down for use on a website. With ImageMagick and a bash for loop, one line of shell code did that for the entire folder.
 
Old 11-03-2018, 09:24 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
You will find some excellent guides to the command line at The Linux Documentation Project.

Some of their stuff is in need of updating, but the books by Machtelt Garrels (particularly BASH Guide for Beginners and Introduction to Linux) are still excellent primers. The command line hasn't changed all that much. The Advanced Bash-Scripting Guide is also worth a look.

I still have a print-out of Introduction to Linux on my bookshelf.

Stuff about system administration, Samba, LDAP, and the like, is likely to be so out of date as to be not much help.

Last edited by frankbell; 11-03-2018 at 09:28 PM.
 
Old 11-04-2018, 01:12 AM   #6
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,863
Blog Entries: 1

Rep: Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869Reputation: 1869
https://cmdchallenge.com/
 
2 members found this post helpful.
Old 11-04-2018, 09:41 AM   #7
Mike25
Member
 
Registered: Feb 2003
Location: ON, Canada
Distribution: Fedora & RH3
Posts: 56
Blog Entries: 2

Rep: Reputation: 11
Quote:
Originally Posted by NevemTeve View Post
I think that's exactly what OP is looking for. I'm enjoying it myself.
 
1 members found this post helpful.
Old 11-04-2018, 12:42 PM   #8
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,491

Rep: Reputation: Disabled
Once proficient at moving around, creating & deleting files, try moving on to some shell scripting, just run two or three simple commands together, put them into a file, & make it executable.

Code:
echo "pwd; ls -lh; free -m; df -h" > info
Code:
chmod +x info
then run your new script by using
Code:
./info
It will print out your present working directory, a listing of all your files, how your ram is being used, how much space you have left.
 
Old 11-04-2018, 12:45 PM   #9
nodir
Member
 
Registered: May 2016
Posts: 222

Rep: Reputation: Disabled
giving up a graphical filemananager and using the terminal to do anything related to filemanaging will give you a lot of possibilitie to learn quick.
All the rest is only on top of that.

You can also do quite some other daily tasks (well: more or less daily) from the terminal:
feh - for picture viewing
scrot - for taking screenshots
irssi - for irc chat
mocp, xmms2 and much more - for listening to music
abcde - to rip CD's
pacpl - to convert audiofiles
mpv - to watch movies
to mention a few.

Also you might want to learn a decent editor. vim or emacs comes to mind. Mainly that in this section. Really.
Learning a multiplexer like gnu screen or tmux is another long term goodie.
Both won't give advantages immediatly, as the stuff mentioned above, but in the long run.

Learning cool bash (or shell tricks) is also a good idea. You will be very quick. To give an example:
Code:
mkdir /home/user/Tmp/some_stuff/some_more_stuff/new_directory && cd !$
&& will test if the first command succeded.
!$ will expand to the last argument of the former command. It's handy if you got a really long path.
The bad news is that i don't know a good place where to look for such tricks. You will run in them over the years. Idling in the irc channel #bash is an idea, perhaps mywiki.wooledge.org or wiki.bash-hackers.org. The programning subsection of linuxquestions.org (so: here) is also always worth to look at.
Perhaps here: http://forums.debian.net/viewtopic.php?t=29655 If you are planning to do so, make sure to carefully read this (the web is full of weird solutions when it comes to bash): http://mywiki.wooledge.org/BashPitfalls

good luck.

Last edited by nodir; 11-04-2018 at 12:47 PM.
 
Old 11-05-2018, 03:21 AM   #10
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
If you want to have some fun with what you are currently learning about the shell, you can have a look at the MIT Terminus game (http://web.mit.edu/mprat/Public/web/.../Web/main.html)
 
Old 11-05-2018, 05:19 PM   #11
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
The Advanced BASH Scripting Guide has a lot of example scripts. They do a good job of showing how things work together.
 
Old 11-06-2018, 10:11 AM   #12
jones5
Member
 
Registered: Mar 2015
Distribution: MX
Posts: 118

Original Poster
Rep: Reputation: 1
Thanks for all the helpful advice - certainly plenty to look at and hopefully pick up some tricks. In answer to Habitual above: I am not sure what I am looking for really - I suppose some easy tasks/tricks that provide insights into the process and keep me interested and motivated on learning CL. Then moving onto the more serious and specific tasks that relate to any projects I am doing on my machine. Once again thanks for the above contributions from all - I am sure other newcomers to Bash will also welcome the suggestions.

Last edited by jones5; 11-06-2018 at 10:12 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Manage Your Tasks from the Command Line with Taskwarrior LXer Syndicated Linux News 0 03-02-2018 06:24 AM
Learning the command line rmcellig Linux - Newbie 13 09-19-2009 05:51 AM
Learning the command line vaidos Linux - Newbie 18 03-28-2008 08:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration