LINUX BASIC COMMANDS

LINUX BASIC COMMANDS

Linux Basic Commands

Knowledge in Linux is a must for the student, technical professionals, fresher, or job seekers. If you want to have an understanding of following us here, you will get complete information about Linux internals and device driver. If you have any query you reach our embedded systems training in Bangalore / +91 8951422196.

Index:

1. passwd(password)
2. man(manual page)
3. ls(list of folders)
4. cd(change directory)
5. mkdir(make directory)
6. rmdir and rm(remove directory and remove folder)
7. cat and cp(concatenation and copy)
8. touch
9. more and less
10. mv(move)
11. head and tail
12. find
13. Some basic important commands

1. passwd

Description: Changes your current password, just give the above command without any arguments in the Linux terminal.
Example: The password that we entered is appeared to be hidden.

2. man

Description: man command in Linux used to display the user manual of any command that we can run on the terminal. It provides a detailed view of the commands which include name, synopsis, options, description, etc.
Example: man =gives a detailed description of how to use man command.

Press enter the command to move page downwards and press ‘q’ to quit or exit from the manual command.
Similarly, man ls =gives the details about the ls command. man passwd-gives=gives the details about the passwd command.

3. ls

Syntax: ls option(s) file/folder
Description: This command will give the list of files and directories.
Example: ls –l =it will show the files in a long list format.

basic commands of linux

ls –a= it will show the files along with the hidden files, generally hidden files start with a dot(.)
In the below figure, the highlighted file is hidden files starting with dot.

linux basic commands with examples

Similarly, some examples of ls commands are,

ls –lh=shows the long list of files/folders in a human-readable format with approximate size.
ls –l ~=shows the folders of home(~tilt symbol represents home directory).

4. cd(change directory)

Description: It changes the current working directory, used to move around in the hierarchy of your file system.
Example: cd ~=it comes to our systems home directory.

linux basic commands

cd. =single dot followed by cd will represent the current working directory.
cd..=double dot followed by cd will represent the back/previous directory.
for the below picture my current directory is sul and the previous directory is Desktop.

linux basic commands for beginners

5. mkdir(make directory)

Description: Create one or multiple directories if they don’t exist.
Example: Create a file name called new_file inside downloads and check with ls, after that create two files inside the download folder and check with ls.

basic commands of linux

6. rmdir and rm(remove/delete directory and remove)

a)rmdir

Description: This command removes each directory specified on the command line, if they are empty, that is each directory removed must contain no files or directories.
Example: If any folder contains inside the directory then the above command doesn’t work. this is shown in the below picture. Inside new2 folder, another folder is there that is new_1, therefore, rmdir new2 won’t work.

basic commands of linux

b)rm

Description: This command removes/delete each file specified on the command line. by default, it doesn’t remove directories.
Example:
rm –r file_name = delete the files and folders recursively from the lower hierarchy.
rm –rv file_name = v is verbose it will show that what is happening and which file we are deleting.

basic linux commands for freshers

rm –fr = here f specifies the forceful deletion(in case of binary file recursively deletion to avoid giving option yes or no while each deletion function.

7. cat(concatenate files) and cp(copy)

a) cat

Description: It can read and concatenate files, writing their contents to the standard output. cat is most commonly used to display the contents of one or multiple text files, combine files by appending the contents of one file to the end of another file, and create new files.

b) cp

Description: This is used to copy the contents of one file to other files. general syntax: cp source destination
Example: cp myfile.txt myfile_copy.txt
Here below figure just shows the usage of cat and cp commands along with some examples.

basic commands of linux

The above picture contains the following steps

  • Here we are creating the one directory name called name test1 in-home directory.
  • Inside the test1 directory, we are creating the two files named old and new.
  • Inside the old directory, we are creating one text file using a touch command named exx in my picture
  • cat file_name.txt=displays the contents in that file.
  • cat > file_name.txt=we can able to write the contents.
  • After writing the contents (ex after hello world) use ctrl+d is end the writing.
  • Again display the file contents using cat < file_name.txt or cat file_name.txt
  • If we again want to write some content and display then previous content will be lost for example (our case hello world will be lost)
  • So we want to keep the previous data also means we need to give cat >> file_name.txt . then give cat file_name.txt then it will display along with the previous contents.
  • If we want to copy the file exx.txt from the old folder to the new folder, then use cp exx.txt ../new/. afterward, check using ls command.

8. touch

Description: Touch command in Linux is used for changing file timestamps if the file exists otherwise creating a new empty file. With the touch command, you can change access, modify and change the time of files and folders in Linux. You can update the timestamps or modify them to a date in the past.

9. more and less

a) more

Description: This command view files or other output in a scrollable manner. it displays the text one screenful at a time and lets you scroll backward and forwards.

b)less

Description: It automatically adjusts with the width and height of the terminal window, while ‘more’ command cuts the content as the width of the terminal window gets shorter.

linux basic commands

After giving the more command it will show 15% of the total number of files and appears until 100%.

10. mv(move command)

Description: mv is used to move one or more files or directories from one place to another in the file system like LINUX. It has two distinct functions: (i) It renames a file or folder. (ii) It moves a group of files to a different directory.
General syntax: mv source_file destination_file
Example: The exx.txt from old is copied into the new folder under the test1 folder. as given in the below figure.

basic commands of linux

11. head and tail

Description: The head will display the starting n number of files in the given folder. n number will optional we can give n number, similarly, the tail will display the n number of files at the end of the folder.
Example: head -5 new.txt= displays the 5 number of lines at the start. less -5 new.txt= displays the 5 number of lines at the end.

12. find(to search file or where we want to go)

Description: It searches one or more directory trees of a file system.
Example: find ~ -name “file_name.filetype” = it will show our file name located in which directory.

13. Some Basic Important Commands in Linux

wc –l new.txt = it shows many lines present in that file.
wc –w new.txt = shows the number of words present in that file.
wc –c new.txt = shows the number of characters present in that file.
exit = exit from the terminal.
clear = clearing the terminal page.
hostname = displays the Linux system normal hostname.
whoami = displays the Linux system normal user name.

basic linux command

sleep = delay in command (example= sleep 1- 1 sec second)
cal year =shows the calendar of the given year.( cal 1997 |less)
top = it shows the currently running process(memory usage or CPU usage, etc)
ps = viewing the process running on the system.
date = this command displays the current date and time. It can also be used to display or calculate a date in a format you specify. The super-user (root) can use it to set the system clock.
time = it can be used to show how long a command takes to run.
history = The history command shows a list of the commands entered since you started the session.
echo = it is printing what we are giving. ex( echo “hello” or echo hello will prints hello in the next line).
shutdown = (shutdown –P now = shutdown Linux os now itself).
pwd = it will print the current working directory.

Professional Training Institute is a pioneer in the embedded system training in Bangalore. Our teaching method is completely practical and hands-on. Explore more here

Structure Pointer

Pointer Variable can also Store the Address of the Structure Variable. Pointer to Array of Structure stores the Base address of the Structure array.

2.1 Write a program to store 1 student information using a structure pointer concept without using array.

MEMORY MAPPING:
1)initially it allocates size of the structure.
2)firstly it allocates 10 memory locations for my name=”priyanka”
3)next it allocates 35 memory locations for mailid,for both age and roll_num it allocates each of 4 byte
for below program i got addressess will be as follow(note address will be changing at each compilation and depending on different PC’s.

/*name=priyanka->0xbf946424
mailid=priyankamn522@gmail.com->0xbf94642e
roll_num=65->0xbf946454
age=22->0xbf946458*/

#include<stdio.h>
#include<string.h>//adding inbuilt for string
library(particularly strcpy)
struct student//structure definition along with tag name
{
char name[10],mailid[35];
int roll_num,age;
};
int main()
{
struct student a,*ptr;//declaration of structure pointer variable
ptr=&a;//pointer variable stores the address of structur variable.
strcpy(ptr->name,”priyanka”);
strcpy(ptr->mailid,”priyankamn522@gmail.com”);
ptr->roll_num=65;
ptr->age=22;
printf(“name=%s->%p\n mailid=%s->%p\n roll_num=%d->%p\n age=
%d->%p\n”,ptr->name,ptr->name,ptr->mailid,ptr->mailid,ptr-
>roll_num,&ptr->roll_num,ptr->age,&ptr->age);
/*printing the one student information using pointers*/
}

2.2 write a program using structure pointer to store 5 students
information without using array.

MEMORY MAPPING:

1st student
name->0xbfd4d7d8
age->0xbfd4d808
rollno->0xbfd4d80c
mailid ->0xbfd4d7e2
marks->0xbfd4d810

2nd student
name ->0xbfd4d814
age ->0xbfd4d844
rollno ->0xbfd4d848
mailid ->0xbfd4d81e
marks ->0xbfd4d84c

3rd student
name ->0xbfd4d850
age ->0xbfd4d880
rollno ->0xbfd4d884
mailid ->0xbfd4d85a
marks ->0xbfd4d888

4th student
name ->0xbfd4d88c
age ->0xbfd4d8bc
rollno ->0xbfd4d8c0
mailid ->0xbfd4d896
marks ->0xbfd4d8c4

5th student
name ->0xbfd4d8c8
age ->0xbfd4d8f8
rollno ->0xbfd4d8fc
mailid ->0xbfd4d8d2
marks ->0xbfd4d900 */

#include<stdio.h>
struct student//structure defination along with data type
declaration of the members
char name[10],mailid[35];
int age,rollno,marks;
int main()
struct student a[10],*ptr;//declaration of structure array along with structure pointer int i;
for(i=0;i<5;i++)//for loop for scannning students information by using pointer concept
{
ptr=&a[i];
printf(“enter the %d student
information:name,age,rollno,mailid,marks\n”,i+1); scanf(“%s %d %d %s %d”,ptr->name,&ptr->age,&ptr >rollno,ptr->mailid,&ptr->marks); ptr++;//for next student information storage location
}
for(i=0;i<5;i++)//for loop for printing the 5 student information using structue pointers and structure array concept
{
ptr=&a[i];
printf(“student %d information is\n name=%s-%p age=%d-
%p rollno=%d-%p mailid=%s-%p marks=%d-%p\n”,i+1,ptr->name,ptr-
>name,ptr->age,&ptr->age,ptr->rollno,&ptr->rollno,ptr-
>mailid,ptr->mailid,ptr->marks,&ptr->marks);
ptr++;//next student information address
}
}

2.3 write a program using structure pointer to store 5 students
information without using array.

MEMORY MAP:

according to my user input
name =priya=0xbf9f84d4
rollno =65=0xbf9f84e0
age =22=0xbf9f84e4
marks =79=0xbf9f84e8
———————————-
name =rita=0xbf9f84ec
rollno =87=0xbf9f84f8
age =23=0xbf9f84fc
marks =67=0xbf9f8500
———————————-
name =sony=0xbf9f8504
rollno =21=0xbf9f8510
age =21=0xbf9f8514
marks =78=0xbf9f8518
———————————-
name =sheela =0xbf9f851c
rollno =71 =0xbf9f8528
age =21 =0xbf9f852c
marks =48 =0xbf9f8530
———————————-
name =smitha =0xbf9f8534
rollno =81 =0xbf9f8540
age =21 =0xbf9f8544
marks =78 =0xbf9f8548
———————————-*/

#include<stdio.h>
struct student//structure defination along with the datatype
declaration of the members
{
char name[10];
int rollno,age,marks;
};
int main()
{
struct student a,b,c,d,e,*p1,*p2,*p3,*p4,*p5;//structure variable declaration along with the structure pointer declaration
p1=&a,p2=&b,p3=&c,p4=&d,p5=&e; printf(“enter the student 1 information name,rollno,age,marks\n”);

//user input of 5 students information one by one using pointer
scanf(“%s %d %d %d”,p1->name,&p1->rollno,&p1->age,&p1- >marks);

printf(“enter the student 2 information name,rollno,age,marks\n”); scanf(“%s %d %d %d”,p2->name,&p2->rollno,&p2->age,&p2- >marks);

printf(“enter the student 3 information name,rollno,age,marks\n”); scanf(“%s %d %d %d”,p3->name,&p3->rollno,&p3->age,&p3- >marks);

printf(“enter the student 4 information name,rollno,age,marks\n”); scanf(“%s %d %d %d”,p4->name,&p4->rollno,&p4->age,&p4- >marks);

printf(“enter the student 5 information name,rollno,age,marks\n”); scanf(“%s %d %d %d”,p5->name,&p5 >rollno,&p5->age,&p5- >marks); 

//printing the five students information using structure pointers:

printf(“the first student information is\n name=%s-%p rollno=%d-%p age=%d-%p marks=%d-%p\n”,p1->name,p1->name,p1- >rollno,&p1->rollno,p1->age,&p1->age,p1->marks,&p1->marks);

printf(“the second student information is\n name=%s-%p rollno=%d-%p age=%d-%p marks=%d-%p\n”,p2->name,p2->name,p2- >rollno,&p2->rollno,p2->age,&p2->age,p2->marks,&p2->marks);

printf(“the third student information is\n name=%s-%prollno=%d-%p age=%d-%p marks=%d-%p\n”,p3->name,p3->name,p3->rollno,&p3->rollno,p3->age,&p3->age,p3->marks,&p3->marks);

printf(“the fourth student information is\n name=%s-%p rollno=%d-%p age=%d-%p marks=%d-%p\n”,p4->name,p4->name,p4- >rollno,&p4->rollno,p4->age,&p4->age,p4->marks,&p4->marks);

printf(“the fifth student information is\n name=%s-%p rollno=%d-%p age=%d-%p marks=%d-%p\n”,p5->name,p5->name,p5- >rollno,&p5->rollno,p5->age,&p5->age,p5->marks,&p5->marks);
}

Structure

Description:

1 Structures:

A structure is a user defined data type in c.A structure creates a data type that can be used to group items of possibly
different types into a single type.

Example:

To store the employee details
struct employee |struct=keyword employee=tag or group
name
{
|
char name[10];
|members or fields of structure
int id[5];
float salary;
};

1.1 Write a program using structures, to store one student information
and print it

#include<stdio.h>
struct student
{
char name[10];
int age;
int roll_no;
int marks;
char mail_id[25];
};
int main()
{
struct student a;//struct student is an data type and a is the
object that holds all information
printf(“enter the student name,age,rollnum,marks and mail_id
orderly\n”);
scanf(“%s %d %d %d
%s”,a.name,&a.age,&a.roll_no,&a.marks,a.mail_id);/*scanning the
student information */
printf(“the student information is”);
printf(“\n name=%s\n age=%d\n roll_no=%d\n marks=%d mail_id=
%s\n”,a.name,a.age,a.roll_no,a.marks
,a.mail_id);//printin
g the student information
}

1.2 Write a program using structures to store 5 student information
and print it without using array.

#include<stdio.h>
struct student
{
char name[10];
int age;
int marks;
int rollnum;
};
int main()
{
struct student a,b,c,d,e;//5 different variables for 5 different
students
printf(“enter student 1 information name,age,rollnum and marks\n”);
scanf(“%s %d %d %d”,a.name,&a.age,&a.marks,&a.rollnum);//scanning
student 1 information upto student 5 below
printf(“enter student 2 information name,age,rollnum and marks\n”);
scanf(“%s %d %d %d”,b.name,&b.age,&b.marks,&b.rollnum);
printf(“enter student 3 information name,age,rollnum and marks\n”);
scanf(“%s %d %d %d”,c.name,&c.age,&c.marks,&c.rollnum);
printf(“enter student 4 information name,age,rollnum and marks\n”);
scanf(“%s %d %d %d”,d.name,&d.age,&d.marks,&d.rollnum);
printf(“enter student 5 information name,age,rollnum and marks\n”); scanf(“%s %d %d %d”,e.name,&e.age,&e.marks,&e.rollnum);
printf(“student 1 information”);//printing the 5 students infromation
printf(“\n name=%s\n age=%d\n marks=%d\n rollnum=
%d\n”,a.name,a.age,a.marks,a.rollnum);
printf(“student 2 information”);
printf(“\n name=%s\n age=%d\n marks=%d\n rollnum=
%d\n”,b.name,b.age,b.marks,b.rollnum);
printf(“student 3 information”);
printf(“\n name=%s\n age=%d\n marks=%d\n rollnum=
%d\n”,c.name,c.age,c.marks,c.rollnum);
printf(“student 4 information”);
printf(“\n name=%s\n age=%d\n marks=%d\n rollnum=
%d\n”,d.name,d.age,d.marks,d.rollnum);
printf(“student 5 information”);
printf(“\n name=%s\n age=%d\n marks=%d\n rollnum=
%d\n”,e.name,e.age,e.marks,e.rollnum);
}

1.3 write a program using structures to store information of 5
students using array and print them.

#include<stdio.h>
struct student//structure definition
{

char name[10],mail_id[35];
int age,roll_num,marks;
};
int main()
{
struct student a[5];//declaring data type of array which stores
our structure members
int i;
for(i=0;i<5;i++)//user input of 5 student information using array
{
printf(“enter the %d student information
name,age,rollnum,emailid and marks in order\n”,i+1);
scanf(“%s %d %d %s
%d”,a[i].name,&a[i].age,&a[i].roll_num,a[i].mail_id,&a[i].marks);
}
for(i=0;i<5;i++)//printing of 5 students information using array
{
printf(“\nstudent %d details”,i+1);
printf(“\n name=%s\n age=%d\n rollno=%d\n mailid=%s\n marks=
%d\n”,a[i].name,a[i].age,a[i].roll_num,a[i].mail_id,a[i].marks);
}
}

Resume Writing Tips For Embedded Students

RESUME WRITING TIPS FOR EMBEDDED STUDENTS, ptinstitute

Resume writing is an Art, a resume should speak very loud and clear. When any company receives your resume then the company will judge your knowledge based on your resume only. We at a Professional Training Institute focus on each student’s resume who join us for embedded system training in Bangalore.

Now, this document we had published for everyone, the student can utilize the information available in this document and make their resume better. This document is divided into two parts one general guideline and the other is embedded specific guidelines.

General Points Need to Cover in Resume

Contact Information

It should include candidate name, contact number and email id. An alternative contact number also benefits some times.

Career Objective for Fresher’s & Experienced Candidates

For fresher’s, it should use

1) I am an entry-level applicant.
2) I am a recent graduate student.

For Experienced, it should use

1) I have/ had major achievement in my experience
2) I am applying to a position in the same industry.
3) I have a special area of expertise in my mind.

Work Experience

Here we need to mention current company work details as first. Freshers can write some projects if they have done, if not then they can study some projects from their interest filed and write here.

Additional Skills

Additional skills are mixed with soft skills like adaptability, collaboration, strong work ethic, problem-solving, team building and hard skills like MS excel proficient, business management, client management, fluent English.

Education

Here education details have to mention from the highest degree to lowest including percentages and year of passing out for freshers. For experienced candidates have to mention only the highest qualification.

If you have fewer % marks in your education then skip writing % marks, just write a year of passing.

Personal Information

Here you have to mention father’s name, date of birth, known languages, etc.

Declaration

This is the final step to complete the resume.

While making a resume specific to an embedded filed, and targeting embedded companies then we need to pay special attention to resume. We have to add some special keywords that are related to an embedded filed.

Here is the details description of what is expected in embedded candidates:

Knowledge of Communication Protocol

The company is normally searching for a keyword like UART, SPI, I2C, RS232, and RS485 in the resume.

Embedded Tools

Knowledge of tools used in embedded like CRO, multi-meter, logic analyzer, power supply, USB to 232 converters, USB to 485 converters, and programming tools like STLink.ICD2/ICD3.

Knowledge of IDE

The important IDE is Keil, MP lab, and code worrier. Apart from this also some more IDE is used in the market. So the candidate must have understanding and knowledge of at least 1-2 IDE.

Knowledge of SDLC

The student must aware of requirement analysis, design, and development, unit testing, testing, and release. Most of the big MNC interview company will defiantly ask about SDLC, so the student should be ready and handy knowledge in the field of SDLC.

Domain Knowledge

Domain knowledge is knowledge of a specific, specialized discipline or field, in contrast to general knowledge or domain-independent knowledge. The term is often used about a more general discipline. as, for example, in describing a software engineer who has a general knowledge of programming, as well as domain knowledge about the pharmaceutical industry. People who have domain knowledge, are often considered specialists or experts in the field.

So we strongly believe that if you make your resume as per required guidelines then defiantly you will have more opportunities to get calls from different companies. If you want to gain knowledge or you want to learn embedded systems practical then you can join our practical hands-on embedded system training course in Bangalore. We are highly focused on individual learning. Chat/ call us on www.ptinstitute.in

En-Query

Your Name*
Subject*
Phone Number*
Email Address*

Message*