• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

need some commands

macromp

the retarded one
#1
hi...we've just started learning linux at uni and i need some simple commands...it's very basic stuff. i've looked around the net and there's so many different versions.
commands to enable telnet, http and ftp with default settings.
commands to display cpu usage, hard drive space available and command to backup home directory to the root's home.

any help would be good thanks.
 

Nick

OSNN Lurker
#3
"top" will give you cpu usage, depends what you want to do but either "tar" or "cp" to backup your files and "df" will show you disk space.

Use "man <command>" to get help on most commands. Man is your friend!
 

X-Istence

*
Political User
#6
Beter hope you have a version of tar which will not loop over and include in the tar what is allready in the tar, and thus create a nice little loop :p.

Look into the --exclude flag for tar.
 

macromp

the retarded one
#8
i'd tell you what version we're using, but we don't know yet...and booooo @ henyman, i'd probably have tried to use that but judging from speedy's post i probably wont!

thanks for the help.
 
#9
macromp said:
i'd tell you what version we're using, but we don't knowyet...and booooo @ henyman, i'd probably have tried to use that butjudging from speedy's post i probably wont!
Yeah you really shouldn't. ;)

rm - Remove/delete
-r - Recursive, all files and subfolders
-f - Force, allways answer yes

But the file systems are pretty well protected unless you're running as root.
 
#10
finding your version: uname -a
deleting a file: rm <filename>
deleting an empty folder: rmdir <foldername>
deleting a folder and its contents: rm -r <foldername>

copying a file: cp <originalFile> <copyOfFile>
copying a folder: cp -R <originalFolder> <copyOfFolder>

moving a file without copying it: mv <originalLocation> <newLocation>
(this is also used to rename a file)
rename a file: mv <originalName> <newName>

Moving around the filesystem
change directory: cd path/to/directory
going up a directory: cd ..
changing to your home directory: cd ~ [OR] cd

listing the contents of a directory: ls
for more information: ls -l
to show hidden files: ls -a
hidden files and information: ls -la

Reckon that should see you through a fair bit if you didnt know it already from above links
 

X-Istence

*
Political User
#11
SPeedY_B said:
You can't do that much damage with rm -rf. Too many locked and protected files. Plus it stopped being funny about 5 years ago ;)
Ill agree on the 5 years ago part, and it stopped being fun is also true, but you can do damage. Even if a file is locked.

All the OS will do if you are root is remove a reference to that inode. If an app has it open, it will still exist, but once that reference count reaches 0, the file is removed, since all files reach 1 reference on reboot, if you have removed that 1 reference before a reboot, you just removed the file. As references to the inode are gone.

So you can do a lot of damage.

but i do agree that:

dd if=/dev/zero of=/dev/hda bs=512 (Linux version, but only if your first HD shows up as /dev/hda (as is the case with most IDE drives))

is a lot more fun :p.

(Run that command and i laugh at you, run taht command twice, i will fall over dead from laughing.)

Zedric said:
Yeah you really shouldn't. ;)

rm - Remove/delete
-r - Recursive, all files and subfolders
-f - Force, allways answer yes

But the file systems are pretty well protected unless you're running as root.
If you are non root, all you should be able to delete are files either:

A. Owned by you: chown xistence
B. Are in a group you are in: chown <randomusername>:<groupyouarein>, AND chmod 070 at least.
C. Are chmod 777. Or read write execute everyone.

So you can still do a lot of damage, but not as much as before.

Henyman said:
rm -rf is very handy ;) :p
BiteSize:~/blah xistence$ ls -al
total 0
drwxr-xr-x 8 xistence xistence 272 25 Jan 13:59 .
drwxr-xr-x 34 xistence xistence 1156 25 Jan 13:59 ..
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file1
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file2
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file3
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file4
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file5
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file6
BiteSize:~/blah xistence$ rm -rf
BiteSize:~/blah xistence$ ls -al
total 0
drwxr-xr-x 8 xistence xistence 272 25 Jan 13:59 .
drwxr-xr-x 34 xistence xistence 1156 25 Jan 13:59 ..
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file1
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file2
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file3
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file4
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file5
-rw-r--r-- 1 xistence xistence 0 25 Jan 13:59 file6


Henyman: not everyone has rm -rf aliased to rm -rf . or even rm -rf /.

Second, on the newer versions of the utility rm -rf / is not allowed, but that can easilly be bypassed with rm -rf /* but that is beside the point.
 
#12
X-Istence said:
but i do agree that:

dd if=/dev/zero of=/dev/hda bs=512 (Linux version, but only if your first HD shows up as /dev/hda (as is the case with most IDE drives))

is a lot more fun :p.

(Run that command and i laugh at you, run taht command twice, i will fall over dead from laughing.)
Hahaha
 

X-Istence

*
Political User
#14
no. That will write NULL to your entire drive, bit by bit. for every single block, if you want to fill it with random crap, try /dev/random.

/dev/zero is a special case. What dd does is read() from /dev/zero, for each read it still returns the same data, in this case NULL, which is then written to the block it is working on. It is a quick and easy way to fill up your HD.

Whereas /dev/random on each read() returns another random character on it's stream.
 

Members online

No members online now.

Latest posts

Latest profile posts

Perris Calderon wrote on Electronic Punk's profile.
Ep, glad to see you come back and tidy up...did want to ask a one day favor, I want to enhance my resume , was hoping you could make me administrator for a day, if so, take me right off since I won't be here to do anything, and don't know the slightest about the board, but it would be nice putting "served administrator osnn", if can do, THANKS

Been running around Quora lately, luv it there https://tinyurl.com/ycpxl
Electronic Punk wrote on Perris Calderon's profile.
All good still mate?
Hello, is there anybody in there? Just nod if you can hear me ...
Xie
What a long strange trip it's been. =)

Forum statistics

Threads
61,962
Messages
673,247
Members
89,020
Latest member
saryrehgy