Jump to content

  • twitter
  • youtube

Welcome to UPES - Tech Community | Dehradun


Sign In 

Create Account
Welcome to UPES - Tech Community | Dehradun, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of UPES - Tech Community | Dehradun by signing in or creating an account.
  • Start new topics and reply to others
  • Subscribe to topics and forums to get email updates
  • Get your own profile page and make new friends
  • Send personal messages to other members.
  • Online chat support - 24/7 for your queries,engage with others.
 

Toggle %s About US

UPES - Tech Community helps the students to find study materials for different engineering specialties like mechanical, civil, electrical, computer science and electronics etc.The community is also sharing the year wise question papers of UPES, Dehradun and even comprised up with latest technology aspects, news, events, tutorials and various types of digital gadget reviews.

Photo

7 Basic Command Lines Everyone Must Know


No replies to this topic

#1 ilLuSion

ilLuSion

    Founder

  • Founder
  • 823 posts
  • 43 thanks
  • LocationDream World

Posted 02 June 2016 - 04:43 PM

There are some things you can only do from the command line, even on Windows. Some of these tools don’t have graphical equivalents, while others are just plain faster to use than their graphical interfaces.

We can’t possibly cover all the useful commands you can use in the Command Prompt or PowerShell here. We’ll be focusing on commands that should be useful even if you’re not a command-line person.

1. Change Directory

Often you will have to navigate through directories. Terminal and Command Prompts both use the same cd command to change your current directory to the destination specified within the command. Say you want to go to a folder namedtech, you type:

1
cd tech

You can navigate directly to the sub-directory of foo, like so:

1
cd tech/sub-folder

To head back to the previous directory or go one level up of the current directory, type:

1
cd ..
2. Create a New Folder

Another command that you may find in need often is mkdir. This command creates a new directory with the specified name. The following command, for example, will create a new directory named tech.

1
mkdir tech

We can also create multiple folders at once. This example below will create three directories named foo, hello, andworld all together at once.

1
mkdir tech hello world

The mkdir command is compatible both in Terminal and Command Prompt.

3. Creating New File

Use thetouch command to create an empty file. For example:

1
touch filename.html

You can specify more filenames, as follows, to create multiple files at once.

1
touch file.html style.css
4. Moving Files

Use the mv command to move a particular file to a folder. This example below moves the tech.css to a folder named/sid.

1
mv tech.css /sid

You can also make use of the mv command to rename files and folders. This example below will rename theindex.html into about.html.

1
mv index.html about.html
5. Copying Files

Type cp command or copy, if you want to copy a file or folder. Below is an example where we copy index.html and name the new file to about.html.

1
cp index.html about.html

If you are running on Windows, use the copy command instead.

6. List Directory Content

This is one of the commands that I personally use often, List Directory or known as ls. With this command, you can list the content of a directory. Specifying a folder name ahead of the ls command will list the content of the folder specified.

The ls command, however, will only work in a UNIX shell. You can run lscommand in Ubuntu and OS X, but not in Windows. In Windows, type dircommand instead.

7. Open Files

The open command will open files of folders in the default app. This command below will open the folder Desktop in Finder.

1
open ~/Desktop

The following command will open a .txt folder in TextEdit, which is the default app in OS X to edit plain text file.

1
open readme.txt

Windows users should use edit. Given the same example, you can run:

1
edit readme.txt

Additionally:

  • You can use exit command to exit from command prompt in windows.
  • You can use ipconfig to quickly find your ip address.

These are only some of the the command lines but they are basic commands everyone must know.

 





Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



Discussion | Topics
Community Guidance
Useful Resources
Connect With Us

Copyright © 2018 UPES - Tech Community | Dehradun. All Rights Reserved.